Hallo Jo@chim,
ich habe in einigen Applikationen von mir eine Aktionsschaltfläche in mailfähigen Masken eingebaut, die dem ANwender die Möglichkeit geben, an der aktuellen Cursorposition die Signatur seiner Mail-DB einzufügen. Vielleicht hilft es dir:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
On Error Goto FehlerAusstieg
Set uidoc=ws.CurrentDocument
If Not uidoc.EditMode Then Exit Sub
Set doc=uidoc.Document
' If you explicitly go to the field BODY your cursor will be placed always
' to the beginning of the field. We want to place the signature to the
' actual cursor position - so we get an error message if the actual field
' is no RT-field - what matters
' Call uidoc.GotoField("Body")
Dim s As NotesSession
Dim db As NotesDatabase
Dim memodb As NotesDatabase
Dim mailprofile As NotesDocument
Dim xitem As Notesitem
Dim SigFile As String
Dim m_vFILTER As Variant
Dim strFileExt As String
Dim strFilterString As String
Dim strFilterList List As String
strFilterList("JPG") = "JPEG Image"
strFilterList("JPEG") = "JPEG Image"
strFilterList("BMP") = "BMP Image"
strFilterList("GIF") = "GIF Image"
strFilterList("HTM") = "HTML File"
strFilterList("HTML") = "HTML File"
strFilterList("TXT") = "ASCII"
Set s=New NotesSession
Set db=s.CurrentDatabase
Set memodb=New NotesDatabase("","")
Call memodb.OpenMail
If memodb Is Nothing Then
Print "No Notes mail-database configured for actual location or configured database not accessible"
Exit Sub
End If
Set mailprofile=memodb.GetProfileDocument("CalendarProfile")
If mailprofile Is Nothing Then
Print "No Profiledocument in maildatabase"
Exit Sub
End If
If Not mailprofile.HasItem("SignatureOption") Then
Print "No Mail Signature option set"
Exit Sub
End If
If mailprofile.SignatureOption(0) = "1" Then
If Not mailprofile.HasItem("Signature_1") Then
Print "Signature entry not found"
Exit Sub
End If
SigFile=mailprofile.Signature_1(0)
strFilterString = ""
Elseif mailprofile.SignatureOption(0) = "2" Then
If Not mailprofile.HasItem("Signature_2") Then
Print "Signature entry not found"
Exit Sub
End If
SigFile = mailprofile.Signature_2(0)
m_vFILTER = Evaluate(|@RightBack("| & SigFile & |";".")|)
If Trim(m_vFILTER(0)) <> "" Then
strFileExt = Trim(Ucase(m_vFILTER(0)))
If Iselement(strFilterList(strFileExt)) = True Then
strFilterString = strFilterList(strFileExt)
End If
Else
' Plain Text: Try or die
strFilterString = ""
End If
End If
uidoc.InsertText(Chr(10))
Call uidoc.Import(strFilterString, SigFile)
Exit Sub
FehlerAusstieg:
Exit Sub
End Sub