ich verwende nachfolgenden Mailcode für Lotus Notes, um eine Mail nach dem Öffnen einer Exceldatei zu versenden.
Das ganze funktioniert prima, denn ich möchte keine Mail im Postausgang hinterlassen.
Problem ist, dass Notes fragt, ob ich die Änderung speichern will.
Meine Frage ist eben, wie kann ich diesen Display-Alert mit "NEIN" bestätigen bzw. zuvor ausschalten und anschließend wieder einschalten?
Wär euch um Hilfe sehr dankbar.
Gruß
A.
Private Sub Workbook_Open()
Dim session As Object
Dim db As Object
Dim doc As Object
Dim strTo As Variant
Dim strPath As String
Dim EmbedObj As Object 'The embedded object (Attachment)
Dim AttachME As Object 'The attachment richtextfile object
Dim Workspace As Object
Dim uidoc As Object
Dim strPfad As String
Dim datnam As String
Dim objSh As Object
Dim wks As Worksheet
Dim verfall As Date
'Filenamex = Environ("UserProfile") & "\Desktop\Feedbackbogen - " & Range("J12").Value & " - " & _
Range("J14").Value & ".xlsm"
Application.ScreenUpdating = False
Set session = CreateObject("Notes.NotesSession")
Set db = session.GetDatabase("", "")
If db.IsOpen = False Then db.OPENMAIL
Set doc = db.CREATEDOCUMENT
With doc
.Form = "Memo"
.sendto = "test@dummy.com"
.Subject = "Wissensmatrix wurde von " & Environ("UserName") & " geöffnet!"
.Sign = "0"
.DisplayAlerts = False
.SAVEMESSAGEONSEND = True
.DeleteAfterSend = True
Set AttachME = doc.CREATERICHTEXTITEM("Attachment")
'Set EmbedObj = AttachME.EmbedObject(1454, "", Filenamex, "") 'Hier dein Anhang
.PostedDate = Now()
End With
Set Workspace = CreateObject("Notes.NotesUIWorkspace")
Set uidoc = Workspace.EDITDOCUMENT(True, doc)
With uidoc
' .GOTOFIELD ("Body")
' Selection.Copy 'oder dein Bereich
' .Paste
.SEND
.Close
End With
Set EmbedObj = Nothing
Set AttachME = Nothing
Set uidoc = Nothing
Set Workspace = Nothing
Set db = Nothing
Set doc = Nothing
Set session = Nothing
End Sub