我有一个 Excel VBA 宏,可以将电子邮件发送给多个人。我不想隐藏已发送给谁,我只想在 Outlook 上禁用“全部答复”功能。
我已经从 Outlook VBA 中尝试了以下内容,但没有效果
ActiveInspector.CurrentItem.Actions("Reply to All").Enabled = False
ActiveInspector.CurrentItem.Actions("Forward").Enabled = False
在代码中。
Set OutlMail = OutlApp.CreateItem(0)
On Error Resume Next
With OutlMail
.To = sendto
.Subject = "Update for: " & Date
Set rng = Workbooks("UpdateV2.xlsm").Sheets("EmailP").Range("A1:S75")
Call SortAbs
Workbooks("UpdateV2.xlsm").Sheets("EmailP").Calculate
.ActiveInspector.CurrentItem.Actions("Reply to All").Enabled = False
.ActiveInspector.CurrentItem.Actions("Forward").Enabled = False
.htmlbody = "<body style=font-size:11pt;font-family:Arial bgcolor='#FBEDD4'>" & _
"Please note that this email is Confidential. Do not forward." & _
"<BR><BR> <i> This is an Automatic Email - Generated by: " & GetUserFullName & "</i> <BR><BR></body>" & RangetoHTML(rng)
.Display
End With
On Error GoTo 0
Set OutlMail = Nothing
谢谢
3 回答
将.ActiveInspector 更改为.GetInspector。
修复。
需要首先显示电子邮件。
则.ActiveInspector.CurrentItem 必须在应用程序上而不是项目上
所以我用了
您不必先显示该项目。将代码更改为