首页 > 解决方案 > 无法在 Microsoft Outlook VBA 中使用 EmailOptions 属性

问题描述

我正在尝试使用 EmailOptions 属性。我在 Microsoft Docs ( https://docs.microsoft.com/en-us/office/vba/api/word.emailoptions ) 上找到了示例,我正在尝试。但它给出了错误:“对象不支持此属性或方法”

我添加了对 MS Word 和 Excel 的引用。我错过了什么?

Option Explicit

Sub x()
With Outlook.Application.EmailOptions.EmailSignature
    If .NewMessageSignature = "" Then
        MsgBox "There is no signature for new " 
    Else
        MsgBox "There is signature for new e-mail"
    End If
End With
End Sub

标签: vbaoutlook

解决方案


EmailOptions属性由Word.Application对象公开,而不是由Outlook.Application对象公开。


推荐阅读