Ich benutze die gleiche Aktion vom Button "Send"
Hier der Quellcode:
Sub Click(Source As Button)
Dim session As New notessession
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim wksp As New NotesUIWorkspace
Dim ok As Integer
Dim sendfrom As String
Dim sendtousers As Variant
Dim copyToUsers As Variant
Dim me_Subject As String
Dim me_message As String
Dim me_embedlink As Integer
Dim me_isfrontend As Integer
Dim subject2 As String
Dim copyto As String
sendfrom = "Bestelldatenbank" 'GetConfigDocByKey("sendMailonBehalfof")
If SendFrom = "" Then
Print "Konfigurationsfehler, Key für 'sendMailonBehalfof' nicht gefunden. Noch mal! Aber erst Fehler beseitigen!!!!"
' Sorry but this was a massive failure
Exit Sub
End If
Set uidoc = wksp.CurrentDocument
subject3=uidoc.FieldGetText("user")
subject2="Neue Bestellung von "
me_subject = subject2+subject3 'uidoc.FieldGetText("user")
me_message = uidoc.FieldGetText("otherusers")
me_embedlink = True
me_isfrontend = False
subject2 = "Neue Bestellung: "
' save the document. If you do not save this document you will not have access to the rtField
Call uidoc.save()
Set doc = uidoc.Document
sendtousers = doc.supporter
copytousers = copyto
Call uidoc.Close(True)
OK = Spoofmessage(_
SendFrom,_
sendtousers, _
copytousers,_
me_subject,_
me_message,_
doc,_
subject2,_
"best_inhalt",_
False,_
False,_
"BugMail",_
"IsManualMail")
If OK = False Then
' Problem, Mail was not send due to an error in the Spoofmessage routines. Check and solve problems before trying again
Print "Das ging daneben. Noch mal! Aber erst Fehler beseitigen!!!!"
' reopen the uidoc
Call wksp.EditDocument(True, doc)
Stop
Else
' set counter for Mail was send and resave the doc
OK =itemtextexists(doc,"MailSendCounter")
If ok = True Then
doc.MailSendCounter = doc.MailSendCounter(0) + 1
Else
doc.MailSendCounter= 1
End If
Call doc.Save(True,False)
End If
End Sub
Es wird jetzt eine Mail mit den Angaben geschickt die ich benötige.
Ich hätte aber gerne den Link zu dem direkt erstellten Dokument...
Ist das möglich?