I Have a Excel VBA script that read Data from a sheet and automatically make a Lotus Notes Email. The script works fine but now i like to add a ExpiryTime or ExpiryDate to the Email but i dont find the field for that.
I Hobe u can help me with that.
Set Maildb = Session.GETDATABASE(Mailserver, Mailkonto)
If Maildb.IsOpen = True Then
'Fertig zum mailen!
Else
Maildb.OPENMAIL
End If
'Ein neues Maildokument erstellen
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
'Mail Empfänger, CC, BCC, übergeben.
Set SendItem = MailDoc.APPENDITEMVALUE("SendTo", "")
Set NCopyItem = MailDoc.APPENDITEMVALUE("CopyTo", "")
Set BlindCopyToItem = MailDoc.APPENDITEMVALUE("BlindCopyTo", "")
MailDoc.sendto = strEmpfaenger
MailDoc.CopyTo = strcc
MailDoc.BlindCopyTo = strbcc
'Dim exDate As New NotesDateTime (" ")
'Dim Expiretime
'Expiretime = DateAdd("h", 8, NowTime)
'Set ExpiryTime = MailDoc.APPENDITEMVALUE("Expiration", "")
'MailDoc.ExpiryTime = Today + 1095
'MailDoc.ExpiryTime = DateAdd("m", 5, Now)
'MailDoc.ExpiryTime = Now + DateSerial(0, 0, 2)
'MailDoc.ExpiryTime = Expiretime
'Betreff Texte Übergeben,
MailDoc.Subject = strBetreff
'Mail Text übergeben.
Set rtitem = MailDoc.CREATERICHTEXTITEM("Body")
'MailDoc.body = strText
'Anhang einfügen.
Call rtitem.EMBEDOBJECT(1454, "", strFilename)
MailDoc.SAVEMESSAGEONSEND = SaveIt
'Mail Body Text mit Signatur.
Signature = Maildb.GetProfileDocument("CalendarProfile").GetItemValue("Signature")(0)
MailDoc.Body = strText & Signature
'Mail erstellen
Dim workspace As Object
Set workspace = CreateObject("Notes.NOTESUIWORKSPACE")
Dim notesUIDoc As Object
Set notesUIDoc = workspace.EDITDOCUMENT(True, MailDoc)
'notesUIDoc.ExpiryTime = DateAdd("m", 5, Now)
'notesUIDoc.ExpiryTime = Now + DateSerial(0, 0, 2)
'notesUIDoc.ExpiryTime = Expiretime
'Body Text löschen wegen doppelten Signatur Problem
Call notesUIDoc.GOTOFIELD("Body")
Call notesUIDoc.FieldClear("Body")
Call notesUIDoc.FieldClear("Footer")
'Body Text + Signatur einfügen
Call notesUIDoc.FieldAppendText("Body", MailDoc.Body)
Call notesUIDoc.EDITDOCUMENT(True, MailDoc).GOTOFIELD("Body")
MsgBox ("Die Mail wurde erstellt")
'Aufräumen
Set Maildb = Nothing
Set MailDoc = Nothing
Set Session = Nothing
Set EmbedObj = Nothing
'######################################################################################
End Function