title image

Smiley Re: Mail aus Visual Basic schicken
Sub Button1_Click() Dim s As Object Dim db As Object Dim doc As Object's and db declared in general as objectSet s = CreateObject("Notes.Notessession") 'create notes sessionSet db = s.getdatabase("", "") 'set db to database not yet namedCall db.openmail 'set database to default mail databaseMycell = Sheet1.Cells(1, 4)Set doc = db.createdocument ' create a mail document msg = "Mail has been sent: " & Date & " " & Time & Chr(10) & 'these 2 lines need... "The value in Cell D1 [ " & Mycell & " ] is in the body of the message" '...to be put on one line Call doc.replaceitemvalue("SendTo", s.UserName) 'Notes client's user name (for testing) Call doc.replaceitemvalue("Subject", "Message") Call doc.replaceitemvalue("Body", msg) Call doc.Send(False) 'send the message 'send the messageMsgBox doc.getitemvalue("Subject")(0) & " has been sent"Set s = Nothing ' close connection to free memoryEnd Sub

geschrieben von




Beitrag anfügen