我有一个Notes应用程序,该应用程序读取打开的Outlook邮箱并为每封电子邮件创建一个文档。这对于Outlook 2013正常工作,但我们最近升级到Outlook2016。当我们尝试运行该程序时,尝试通过OLE访问MailItem的某些部分时,我们开始出现“自动化对象”错误。主题并非一切正常,但SenderEmailAddress不能正常工作。
Dim docMemo as NotesDocument
Const olFInbox = 6
Set olapp = GetObject(, "Outlook.Application")
Set ns = olapp.getnamespace("mapi")
Set inbox = ns.GetDefaultFolder(olFInbox)
Set col = inbox.items
ForAll msg In col
Set docMemo = New NotesDocument(db)
If UCase(msg.SenderEmailType) = "EX" Then
email = msg.Sender.getExchangeUser().PrimarySmtpAddress
Else
email = msg.SenderEmailAddress
End If
Call docMemo.Replaceitemvalue("Form", "Memo")
Call docMemo.Replaceitemvalue("Subject", msg.subject)
Call docMemo.Replaceitemvalue("Body", msg.HTMLBody)
Call docMemo.Replaceitemvalue("From", msg.SenderName)
Call docMemo.Replaceitemvalue("SMTPOriginator", email)
Call docMemo.Replaceitemvalue("PostedD", msg.SentOn)
Call docMemo.Replaceitemvalue("CBy", currentUser)
Call docMemo.Save(true, false)
End ForAll
是否可以设置一个阻止LotusScript读取MailItem所有属性的选项或参数?