Domino 9 und frühere Versionen > ND7: Administration & Userprobleme

E-Mail Serienbrief mit Anhang (Mail Merge to E-mail with attachments)

<< < (3/3)

Driri:
Alternativ gibt es für so etwas auch fertige Tools, z.B. von Manfred Dillmann easyMail.

Wobei Du dann halt die Serienmail auch komplett in Notes erstellst. Ein Import der Adressen aus einer Excelliste ist natürlich möglich.

Henry168:
Hallo,

ich habe folgendes Makro mal von meiner Vorgängerin erhalten:

Sub emailmergewithattachments()

Dim maildb    'As NotesDatabase' 'Die Maildatenbank
Dim doc    'As NotesDocument' 'Maildokument
Dim attachme    'As NotesRichTextItem' 'Anhang  Richtext
Dim session    'As NotesSession' 'Notes Session
Dim embedobj    'As NotesEmbeddedObject' 'Eingebettest Objekt
Dim ws    'AS NotesUIWorkspace' 'Front-End-User-Interface
Dim profile 'As NotesDocument
Dim rtsignature 'As NotesRichTextItem
Dim rtBody 'As NotesRichTextItem
Dim bolSignaturEnabled 'As Boolean
Dim uidoc 'As NotesUIDocument

Set session = CreateObject("Notes.NotesSession")
Set maildb = session.GetDatabase("", "")
maildb.OPENMAIL
' Open the catalog mailmerge document
With Dialogs(wdDialogFileOpen)
    .Show
End With
Set Maillist = ActiveDocument

' Show an input box asking the user for the subject to be inserted into the email messages
message = "Enter the subject to be used for each email message."    ' Set prompt.
title = " Email Subject Input"    ' Set title.
' Display message, title
mysubject = InputBox(message, title)

' Iterate through the Sections of the Source document and the rows of the catalog mailmerge document,
' extracting the information to be included in each email.
For j = 1 To Source.Sections.Count - 1
    Set oItem = oOutlookApp.CreateItem(olMailItem)
    With oItem
        .Subject = mysubject
        .Body = Source.Sections(j).Range.Text
        Set Datarange = Maillist.Tables(1).Cell(j, 1).Range
        Datarange.End = Datarange.End - 1
        .To = Datarange
        For i = 2 To Maillist.Tables(1).Columns.Count
            Set Datarange = Maillist.Tables(1).Cell(j, i).Range
            Datarange.End = Datarange.End - 1
            .Attachments.Add Trim(Datarange.Text), olByValue, 1
        Next i
        .Send
    End With
    Set oItem = Nothing
Next j
Maillist.Close wdDoNotSaveChanges

'  Close Outlook if it was started by this macro.
If bStarted Then
    oOutlookApp.Quit
End If

MsgBox Source.Sections.Count - 1 & " messages have been sent."

'Clean up
Set oOutlookApp = Nothing

End Sub

Ich bekomme aber leider ein Fehler bei der Rot markierten Zeile. Kann mir einer sagen was das bedeutet?

DAnke.

Gruß

Henry


ascabg:
Hallo,

Waere jetzt noch schoen zu wissen, was fuer einen Fehler genau Du in der besagten Zeile erhaelst?


Andreas

Henry168:
Der Fehler lautet:

Run time error '424'

Object Required

Wie gesagt ich bin ein ecter Anfänger was das angeht.

Bastel123:
Na, er erwartet ein object "source". Und das ist nirgends dimensioniert mit Dim, instantiiert oder von aussen übergeben.

Schau mal in die andern Scripte, das steht so was drin.

Sebastian

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln