简体   繁体   English

在Outlook邮件预览窗口中打开URL

[英]Open url in outlook message preview window

Currently I have code that will extract information from outlook message subject line and use this to open a link in IE. 目前,我有一些代码将从Outlook邮件主题行中提取信息,并使用它在IE中打开链接。

I managed to break outlook the other day and these url's started opening in the outlook message preview window. 前几天,我设法中断了Outlook的访问,这些URL开始在Outlook消息预览窗口中打开。

:) Does any one have any pointers on how can I code this so it happens on purpose? :)有人对我如何编写代码有任何指示,以便它有意识地发生吗?

I want to open the url inside the outlook application window instead of opening the url in internet explorer. 我想在Outlook应用程序窗口中打开URL,而不是在Internet Explorer中打开URL。

If subj <> "" Then
        Dim IE As Object
        With CreateObject("Shell.Application").Windows
            If .Count > 0 Then
        ' Get IE
                Set IE = .Item(0) '.Item(.Count + 1)
            Else
        ' Create IE
                Set IE = CreateObject("InternetExplorer.Application")
                IE.Visible = True
            End If
        IE.Navigate "url here"
        Set IE = Nothing
        End With
        Exit Sub
End If

Thanks aj 谢谢你

是的,您可以通过设置Applicatiobn.ActiveExplorer.CurrentFolder属性来创建一个临时文件夹并将其激活。

There several way to implement this task in Outlook. 有几种方法可以在Outlook中实现此任务。

  1. Use the home page for the Outlook folder. 将主页用于Outlook文件夹。 The WebViewURL property allows to set a string indicating the URL of the Web page that is assigned to a folder. WebViewURL属性允许设置一个字符串,该字符串指示分配给文件夹的网页的URL。

    Sub SetupFolderHomePage() Dim nsp As Outlook.NameSpace Dim mpfInbox As Outlook.Folder 子SetupFolderHomePage()Dim nsp作为Outlook.NameSpace Dim mpfInbox作为Outlook.Folder
    Dim mpfNew As Outlook.Folder 昏暗的mpf新作为Outlook.Folder
    Set nsp = Application.GetNamespace("MAPI") 设置nsp = Application.GetNamespace(“ MAPI”)
    Set mpfInbox = nsp.GetDefaultFolder(olFolderInbox) 设置mpfInbox = nsp.GetDefaultFolder(olFolderInbox)
    Set mpfNew = mpfInbox.Folders.Add("MyFolderHomePage") 设置mpfNew = mpfInbox.Folders.Add(“ MyFolderHomePage”)
    mpfNew.WebViewURL = " http://www.microsoft.com " mpfNew.WebViewURL =“ http://www.microsoft.com
    mpfNew.WebViewOn = True mpfNew.WebViewOn = True
    End Sub 结束子

  2. Create an adjacent Outlook window and injkect it into the explorer window. 创建一个相邻的Outlook窗口并将其注入资源管理器窗口。 See Adjacent Windows In Outlook and Creating Adjacent Windows In Outlook for more information. 有关更多信息,请参见Outlook中的相邻WindowsOutlook中的 创建相邻Windows

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM