【发布时间】:2020-12-14 07:45:11
【问题描述】:
我有代码,当我回复邮件时会询问应将回复保存到哪个文件夹。
我需要扩展它以将我回复的邮件(父邮件)移动到我为回复邮件选择的文件夹中。
如果我可以使用会话 ID 制作父邮件的对象,我觉得可以做到这一点?
Public Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim myFolder As MAPIFolder
Dim myOlApp As Outlook.Application
Dim myOlExp As Outlook.Explorer
If Environ("MailSave") = True Then
If TypeName(Item) = "MailItem" Then
Set myOlApp = CreateObject("Outlook.Application")
Set olNS = myOlApp.GetNamespace("MAPI")
Set myFolder = olNS.PickFolder
'todo
If Not (myFolder Is Nothing) Then
Set Item.SaveSentMessageFolder = myFolder
'Item.Parent.Move myFolder ---I tried this. But it is wrong I know
' MsgBox ("All moved")
End If
End If
End If
End Sub
【问题讨论】: