Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello. I'm new in lotusscript and I want to update signature rich text from html file every time when I create new mail and I can acces the file. So when I will change html file automatic it will change signature. I have tryed in onload event of Message form below code, but not luck. I use Domino Designer 8.5. I have try also load it in CalendarProfile Form, but after form closing any change lost.
Sub Onload(Source As Notesuidocument)
'*********************************************************
'Refresh Signature from html file and if file is aviable
'*********************************************************
If source.IsNewDoc Then 
    Dim session As New NotesSession

    'Open users mail database
    Set dbMail = session.CurrentDatabase

    If Not dbMail.IsOpen Then
        Call dbMail.OpenMail
    End If

    Set docProfile = dbMail.GetProfileDocument("CalendarProfile")

    'Check if file exist
    If Not Dir$( "mypath\fileName.html", 0 ) = "" Then

        Set workspace = CreateObject("Notes.NotesUIWorkspace")
        Call workspace.EditDocument(True, Source)
        Set curDoc =  source.Document

        Dim tmpRich As New NotesRichTextItem( curDoc , "Signature_Rich" )

        Call source.GotoField("Signature_Rich")
        Call source.Import("HTML File", "mypath\fileName.html") '// seems that Import does not exist.
        Set newRich= curDoc.GetFirstItem("Signature_Rich")

        Dim richTextItem As New NotesRichTextItem( docProfile , "Signature_Rich" )
        Call richTextItem.AppendRTItem (newRich)
        'Call richTextItem.AppendText ("test")
        Call docProfile.Save(True, False) 
    End If
End If 
End Sub
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900