【发布时间】:2018-05-01 22:20:44
【问题描述】:
在 Outlook 2013 之前,我能够通过宏使用特定 IMAP 帐户发送新邮件。
自 Outlook 2016 以来,我收到了一条错误消息: “运行时错误'9':下标超出范围”
代码如下:
Sub createMailIMAP()
Dim MyMail As MailItem, _
olkInspector As Outlook.Inspector, _
olkSendThroughBtn As CommandBarPopup, _
olkSendAccount As CommandBarButton
Set MyMail = Application.CreateItem(olMailItem)
MyMail.BodyFormat = olFormatPlain
MyMail.Body = ""
MyMail.Display
Set olkSendThroughBtn = Application.ActiveInspector.CommandBars("Standard").Controls(3)
Set olkSendAccount = olkSendThroughBtn.Controls(2)
olkSendAccount.Execute
End Sub
注意:outlook 配置了 Exchange 帐户,并且有一个额外的共享邮箱。
此代码是否已在 Outlook 2016 中弃用? 干杯 宝。
【问题讨论】: