【问题标题】:IE automation via Outlook - Permission Denied issues通过 Outlook 实现 IE 自动化 - 权限被拒绝问题
【发布时间】:2018-11-28 07:21:46
【问题描述】:
Sub test()
    Dim objShell As Object
    Dim objShellWindows As Object
    Dim objWin As Object

    Set objShell = CreateObject("Shell.Application")
    Set objShellWindows = objShell.Windows

    For Each objWin In objShellWindows
        If TypeName(objWin.Document) = "HTMLDocument" Then
            Debug.Print objWin.Document.Location
        End If
    Next objWin 
End Sub

这在 Excel、Access、Word 和 PowerPoint 中运行良好,但从 Outlook 运行时会在 Debug.Print 行上引发“运行时错误 70 - 权限被拒绝”错误。我正在使用后期绑定来排除引用问题。还检查了 Outlook 宏设置,并将它们与其他 Office 应用程序进行了比较——对我来说一切都很好。为什么它在 Outlook 中失败?

【问题讨论】:

    标签: vba outlook ms-office


    【解决方案1】:

    试试这个。返回与位置相同

    Debug.Print objWin.Document.Url
    

    谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-30
      • 2011-02-17
      • 2015-01-28
      • 2015-05-24
      • 2021-08-30
      • 2011-07-11
      • 2011-03-09
      • 2012-12-29
      相关资源
      最近更新 更多