NotesDocument.GetMIMEEntity 总是 returns 没有
NotesDocument.GetMIMEEntity always returns Nothing
我正在尝试创建一个 Excel VBA 宏来访问 Lotus Notes 邮箱的电子邮件文档。
以下代码检查 "Body"
NotesItem
的类型,以及 NotesDocument.GetMIMEEntity()
在 Session.ConvertMime
设置为 [=20 的 NotesDocument
后是否有效=] 和 False
.
Sub Test()
Dim Session As NotesSession, DB As NotesDatabase, Doc As NotesDocument
Set Session = GetSession("xxx")
Set DB = Session.GetDatabase("", "yyy")
Session.ConvertMime = False
Set Doc = DB.AllDocuments.GetFirstDocument
Debug.Print TypeName(Doc.GetFirstItem("Body")), Doc.GetMIMEEntity Is Nothing
Session.ConvertMime = True
Set Doc = DB.AllDocuments.GetFirstDocument
Debug.Print TypeName(Doc.GetFirstItem("Body")), Doc.GetMIMEEntity Is Nothing
Debug.Print TypeName(Doc.CreateMIMEEntity("Body2"))
End Sub
我期待得到这个结果:
IMIMEEntity False
IRichTextItem True
IMIMEEntity
相反,我得到了这个:
IRichTextItem True
IRichTextItem True
IMIMEEntity
您真的确定您的数据库 "AllDocuments" 集合中的第一个文档是 MIME 邮件吗?
"ConvertMime"- 参数只有在有 MIME 要转换时才相关。但是邮件可以完全采用 NRPC 路由,而永远不会转换为 MIME。在默认设置下,来自一个使用 Notes 客户端的本地 Notes 用户发往另一个 Notes 用户的每封邮件都将是 NotesRichtext 而不是 Mime...
因此:对于 "normal" Notes/Domino 环境中的大量邮件,您的预期是错误的。
我正在尝试创建一个 Excel VBA 宏来访问 Lotus Notes 邮箱的电子邮件文档。
以下代码检查 "Body"
NotesItem
的类型,以及 NotesDocument.GetMIMEEntity()
在 Session.ConvertMime
设置为 [=20 的 NotesDocument
后是否有效=] 和 False
.
Sub Test()
Dim Session As NotesSession, DB As NotesDatabase, Doc As NotesDocument
Set Session = GetSession("xxx")
Set DB = Session.GetDatabase("", "yyy")
Session.ConvertMime = False
Set Doc = DB.AllDocuments.GetFirstDocument
Debug.Print TypeName(Doc.GetFirstItem("Body")), Doc.GetMIMEEntity Is Nothing
Session.ConvertMime = True
Set Doc = DB.AllDocuments.GetFirstDocument
Debug.Print TypeName(Doc.GetFirstItem("Body")), Doc.GetMIMEEntity Is Nothing
Debug.Print TypeName(Doc.CreateMIMEEntity("Body2"))
End Sub
我期待得到这个结果:
IMIMEEntity False
IRichTextItem True
IMIMEEntity
相反,我得到了这个:
IRichTextItem True
IRichTextItem True
IMIMEEntity
您真的确定您的数据库 "AllDocuments" 集合中的第一个文档是 MIME 邮件吗?
"ConvertMime"- 参数只有在有 MIME 要转换时才相关。但是邮件可以完全采用 NRPC 路由,而永远不会转换为 MIME。在默认设置下,来自一个使用 Notes 客户端的本地 Notes 用户发往另一个 Notes 用户的每封邮件都将是 NotesRichtext 而不是 Mime...
因此:对于 "normal" Notes/Domino 环境中的大量邮件,您的预期是错误的。