使用VSTO 2016 word插件时,默认浏览器无法打开外部链接



我使用的是2016VSTO插件

在任务窗格中,我打开了我的网站的URL,其中有一些外部超链接。

我的默认浏览器是Google chrome,但外部链接仍然在IE中打开。

我尝试了下面的url。

https://answers.microsoft.com/en us/msoffice/forum/all/office -不会打开超链接,默认browser/d856aeff - 081 b - 4 - e26 - 9626 - 40 - b23bf3de42

下面的URL表示不可能

如何在word插件中设置默认浏览器

如有任何帮助,不胜感激。

感谢

在任务窗格中,您可以使用LinkLabel控件,该控件允许处理链接上的点击,并以以下方式以编程方式运行系统默认的web浏览器:

public void InitializeLinkControl()
{
// Create the LinkLabel.
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
// Configure the LinkLabel's location. 
// this.linkLabel1.Location = new System.Drawing.Point(34, 56);
// Specify that the size should be automatically determined by the content.
this.linkLabel1.AutoSize = true;
// Add an event handler to do something when the links are clicked.
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
// Set the text for the LinkLabel.
this.linkLabel1.Text = "Visit Microsoft";
}
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
// Specify that the link was visited.
this.linkLabel1.LinkVisited = true;
// Navigate to a URL.
System.Diagnostics.Process.Start("http://www.microsoft.com");
}