如何在 Lotus Notes 的 MIME 电子邮件中包含 DocLink?
How to include a DocLink in a MIME Email in Lotus Notes?
我希望使用 LotusScript
获取有关文档的 DocLink
或 link 的值以包含在 MIME
电子邮件中,但我没有知道怎么做了。
我有这个:
Sub Click(Source As Button)
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim body As NotesMIMEEntity
Dim header As NotesMIMEHeader
Dim stream As NotesStream
Set db = s.CurrentDatabase
Set stream = s.CreateStream
s.ConvertMIME = False
Set doc = db.CreateDocument
doc.Form = "Memo"
Set body = doc.CreateMIMEEntity
Set header = body.CreateHeader("Subject")
Call header.SetHeaderVal("HTML message")
Set header = body.CreateHeader("To")
Call header.SetHeaderVal("email_domain")
Call stream.writetext(|<HTML>|)
Call stream.writetext(|<body>|)
user$ = s.CommonUserName
Call stream.writetext(|<br><font size="+5" color="red">| & user$ &|</font>|)
Call stream.WriteText(|<br><a href="notes:///server/etc/etc">Notes</a><br>|)
Call stream.writetext(|</body>|)
Call stream.writetext(|</html>|)
Call body.SetContentFromText(stream, "text/HTML;charset=UTF-8", ENC_IDENTITY_7BIT)
Call doc.Send(False)
s.ConvertMIME = True
End Sub
在此代码中,我可以包含带有 URL 注释的 <a></a>
标记,但我真的想像使用 AppendDocLink
一样生成此文档的 link .
可能吗?
我终于找到了 UniversalID
的解决方案。我检索了文档的 ID
并添加到 URL,就像这样。
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim doc2 As NotesDocument
Dim body As NotesMIMEEntity
Dim header As NotesMIMEHeader
Dim stream As NotesStream
Dim urldoc As String
Set doc2 = ws.CurrentDocument.Document
Set db = s.CurrentDatabase
Set stream = s.CreateStream
s.ConvertMIME = False
urldoc = doc2.UniversalID
Set doc = db.CreateDocument
doc.Form = "Memo"
Set body = doc.CreateMIMEEntity
Set header = body.CreateHeader("Subject")
Call header.SetHeaderVal("HTML message")
Set header = body.CreateHeader("To")
Call header.SetHeaderVal("email")
Call stream.writetext(|<HTML>|)
Call stream.writetext(|<body>|)
user$ = s.CommonUserName
Call stream.writetext(|<br><font size="+5" color="red">| & user$ &|</font>|)
Call stream.WriteText(|<br><a href="Notes://Server/Replica/View/| & urldoc & |">Notes</a><br>|)
Call stream.writetext(|</body>|)
Call stream.writetext(|</html>|)
Call body.SetContentFromText(stream, "text/HTML;charset=UTF-8", ENC_IDENTITY_7BIT)
Call doc.Send(False)
s.ConvertMIME = True
End Sub
我希望使用 LotusScript
获取有关文档的 DocLink
或 link 的值以包含在 MIME
电子邮件中,但我没有知道怎么做了。
我有这个:
Sub Click(Source As Button)
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim body As NotesMIMEEntity
Dim header As NotesMIMEHeader
Dim stream As NotesStream
Set db = s.CurrentDatabase
Set stream = s.CreateStream
s.ConvertMIME = False
Set doc = db.CreateDocument
doc.Form = "Memo"
Set body = doc.CreateMIMEEntity
Set header = body.CreateHeader("Subject")
Call header.SetHeaderVal("HTML message")
Set header = body.CreateHeader("To")
Call header.SetHeaderVal("email_domain")
Call stream.writetext(|<HTML>|)
Call stream.writetext(|<body>|)
user$ = s.CommonUserName
Call stream.writetext(|<br><font size="+5" color="red">| & user$ &|</font>|)
Call stream.WriteText(|<br><a href="notes:///server/etc/etc">Notes</a><br>|)
Call stream.writetext(|</body>|)
Call stream.writetext(|</html>|)
Call body.SetContentFromText(stream, "text/HTML;charset=UTF-8", ENC_IDENTITY_7BIT)
Call doc.Send(False)
s.ConvertMIME = True
End Sub
在此代码中,我可以包含带有 URL 注释的 <a></a>
标记,但我真的想像使用 AppendDocLink
一样生成此文档的 link .
可能吗?
我终于找到了 UniversalID
的解决方案。我检索了文档的 ID
并添加到 URL,就像这样。
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim doc2 As NotesDocument
Dim body As NotesMIMEEntity
Dim header As NotesMIMEHeader
Dim stream As NotesStream
Dim urldoc As String
Set doc2 = ws.CurrentDocument.Document
Set db = s.CurrentDatabase
Set stream = s.CreateStream
s.ConvertMIME = False
urldoc = doc2.UniversalID
Set doc = db.CreateDocument
doc.Form = "Memo"
Set body = doc.CreateMIMEEntity
Set header = body.CreateHeader("Subject")
Call header.SetHeaderVal("HTML message")
Set header = body.CreateHeader("To")
Call header.SetHeaderVal("email")
Call stream.writetext(|<HTML>|)
Call stream.writetext(|<body>|)
user$ = s.CommonUserName
Call stream.writetext(|<br><font size="+5" color="red">| & user$ &|</font>|)
Call stream.WriteText(|<br><a href="Notes://Server/Replica/View/| & urldoc & |">Notes</a><br>|)
Call stream.writetext(|</body>|)
Call stream.writetext(|</html>|)
Call body.SetContentFromText(stream, "text/HTML;charset=UTF-8", ENC_IDENTITY_7BIT)
Call doc.Send(False)
s.ConvertMIME = True
End Sub