简体   繁体   中英

How can I display a web page inside Outlook 2013 with C#

I'm developing a ribbon for Outlook 2013 and I need one of its buttons to show a web page inside Outlook (I mean, as it happens when you clic in a folder with an URL on it)

Any ideas of what could I do?

Thanks a lot!

You can use the WebViewURL property of the Folder class which allows to set a string indicating the URL of the Web page that is assigned to a folder.

Sub SetupFolderHomePage()  
  Dim nsp As Outlook.NameSpace  
  Dim mpfInbox As Outlook.Folder  
  Dim mpfNew As Outlook.Folder 
  Set nsp = Application.GetNamespace("MAPI")  
  Set mpfInbox = nsp.GetDefaultFolder(olFolderInbox)  
  Set mpfNew = mpfInbox.Folders.Add("MyFolderHomePage")  
  mpfNew.WebViewURL = "http://www.microsoft.com"  
  mpfNew.WebViewOn = True  
End Sub

Be aware, you need to set NonDefaultStoreScript key in the windows registry to get the WebView properties working in Outlook. See You cannot add a URL to the Address box on the Home Page tab in Outlook 2007 for more information.

Also you may consider using the WebViewPane layout from ADX. The solution is based on the WebViewURL property and requires the windows registry key as well, but provides a more convinient way to set up a windows form with .net controls. See the similar forum thread for more information.

You can create a form region and put there the web browser control. https://msdn.microsoft.com/en-us/library/bb386301.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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