0
我想将邮件移动到不同的文件夹,然后将链接返回到移动的邮件。如果没有移动它的工作原理为:Outlook VBA链接到移动的邮件
Dim objMail As Outlook.MailItem
Dim sFrag As String
Set objMail = Application.ActiveExplorer.Selection.Item(i_item)
sFrag = "<a href='outlook:" + objMail.EntryID + "'>" + objMail.Subject + "</a>""
在这里有串sFrag
在适当的超级链接提供了一个有效的Outlook元素。如果我点击一个包含此属性的超链接,该元素将在Outlook中打开。
但是,如果我这样扩大到:
Dim objMail As Outlook.MailItem
Dim sFrag As String
Dim oOlApp As Outlook.Application
Dim targetFolder As folder
Set objMail = Application.ActiveExplorer.Selection.Item(i_item)
Set oOlApp = Outlook.Application
Set objNmSpc = oOlApp.GetNamespace("MAPI")
Set targetFolder = objNmSpc.PickFolder
objMail.Move targetFolder
sFrag = "<a href='outlook:" + objMail.EntryID + "'>" + objMail.Subject + "</a>"
后,在sfrag
链接失败。如果我想打开此链接,Outlook-Windows将显示Operation failed
。似乎objMail.EntryID
在objMail.Move
命令后未正确更新。
为什么?如何解决这个问题?
没有工作。感谢你的快速帮助。 – BerndGit