当我回复群组收件箱中的电子邮件时,Outlook默认使用该群组的帐户发送邮件。所以我通常做的是点击“发件人”下的下拉菜单,然后选择“其他电子邮件地址”。
我已经编写了一个小VBA宏,让Outlook 2010使用我的帐户而非群组帐户回复群组收件箱中的电子邮件,但出于某种原因,当我执行下面显示的宏时,它仍然会从我的群组帐户回复。任何想法我的VBA宏有什么问题?感谢
Sub ReplyFromMyAccount()
Dim rpl As Outlook.MailItem
Dim itm As Object
itm = GetCurrentItem()
If Not itm Is Nothing Then
rpl = itm.ReplyAll
rpl.SendUsingAccount = Session.Accounts.Item(1)
rpl.Display()
End If
rpl = Nothing
itm = Nothing
End Sub
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
objApp = Application
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
GetCurrentItem = objApp.ActiveInspector.CurrentItem
End Select
objApp = Nothing
End Function
答案 0 :(得分:0)
尝试.SentOnBehalfOfName
这里描述的可能存在异常。 Outlook code is working when manually called but giving trouble from Application_ItemSend