【问题标题】:VBScript Outlook 2016 send new message from specific IMAP accountVBScript Outlook 2016 从特定 IMAP 帐户发送新消息
【发布时间】: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 中弃用? 干杯 宝。

【问题讨论】:

    标签: vbscript outlook


    【解决方案1】:

    控件集合现在为空 (Controls.Count == 0)。 - Outlook 2016 使用功能区。

    改为设置MailItem.SendUsingAccount 属性。

    【讨论】:

      猜你喜欢
      • 2013-01-31
      • 2015-07-26
      • 2019-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-25
      相关资源
      最近更新 更多