我是lotusscript中的新手,每次我可以訪問該文件時,我都想從html文件更新簽名富文本。所以當我將自動更改html文件時,它將改變簽名。 我已經嘗試在代碼下面的onload窗體事件,但不是運氣。我用Domino Designer中8.5從lotusscript更新文件簽名
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
你把這段代碼放在哪裏? 「Onload」 - 哪種形式的事件? Onload事件通常發生在早期,並且使用「Call workspace.EditDocument(True,Source)」更改當前文檔窗口(並且我不確定,如果此工作在onLoad中)...並且:此代碼將NotesUIDocument和NotesDocument並永遠不能正常運行。 – 2014-11-05 09:51:31
我在消息表單中運行它。我的NotesDocument混合NotesUIDocument,因爲我無法找到任何解決方案從文件 – santipianis 2014-11-05 10:15:49
更新豐富的簽名我已經嘗試使用CalendarProfile表單簽名NotesUIDocument但關閉窗體後,不保留任何變化 – santipianis 2014-11-05 10:24:57