Das Notes Forum

Domino 9 und frühere Versionen => ND7: Entwicklung => Thema gestartet von: jo@chim am 02.04.08 - 12:39:06

Titel: Standardsignatur per LS greifen
Beitrag von: jo@chim am 02.04.08 - 12:39:06
Ich erstelle per Lotusscript über die Methode db.OpenMail  im Frontend eine Infomail mit Link auf das gewählte Dokument.

Wie komme ich an die unter Werkzeuge | Vorgaben | Signatur eingestellte Standardsignatur des Benutzers?
Titel: Re: Standardsignatur per LS greifen
Beitrag von: koehlerbv am 02.04.08 - 12:44:06
Die Signatur steht im Feld Signature im "(Calendar Profile)".

Bernhard
Titel: Re: Standardsignatur per LS greifen
Beitrag von: Axel am 02.04.08 - 12:45:48
Über das FRontend glaube ich garnicht Die Signature ist im Feld Signature_1 im Profildocument abgelegt.

Ich hab's im Backend mal so gelöst:

...
Set profile = maildb.GetProfileDocument("CalendarProfile")
Set maildoc = New NotesDocument(maildb)
maildoc.Form = "Memo"
maildoc.Logo = profile.DefaultLogo(0)
maildoc.Principal = profile.Owner(0)
...
...
'Signatur ans Body-Feld anhängen
Call rtitem.AppendText(profile.Signature_1(0))


Axel
Titel: Re: Standardsignatur per LS greifen
Beitrag von: jo@chim am 02.04.08 - 13:59:50
@Bernhard: thX

@Axel - auch Dir danke - das mit dem Frontend hattest Du falsch verstanden: ich generiere das Dokument im Backend, öffne es per ws.EditDocument und lösche es wieder. So bekomme ich meinen Doclink als Text ins Body...
Titel: Re: Standardsignatur per LS greifen
Beitrag von: LN4ever am 02.04.08 - 20:14:16
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