I'm working on an app to open diferent links and I want to open it on Internet explorer on a tab as many links I clicked I'm using the code belown but it works with Microsoft Edge and not with internet Exprorer. Can someone help me?
else if (browser_box.Text == "Explorer")
{
//var shellWindows = new SHDocVw.ShellWindows();
//var shellWindows = new SHDocVw.ShellWindows();
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
if (shellWindows.Count > 0)
{
InternetExplorer ie = shellWindows.Item(0);
//InternetExplorer ie = new SHDocVw.InternetExplorer();
openNewInternetExplorerTab(ref ie, web_link);
}
else
{
InternetExplorer ie = openNewInternetExplorerInstance(web_link);
}
}
THERE ARE openNewInternetExplorerTab AND openNewInternetExplorerInstance FUNCTIONS
public static InternetExplorer openNewInternetExplorerInstance(string url)
{
// Create an InternetExplorer instance
//InternetExplorer ie = new InternetExplorer();
SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
// Open the URL
ie.Navigate2(url, ref m, ref m, ref m, ref m);
// Make InternetExplorer visible
ie.Visible = true;
return ie;
}
// public static void openNewInternetExplorerTab(ref InternetExplorer ie, string url)
public static void openNewInternetExplorerTab(ref SHDocVw.InternetExplorer ie, string url)
{
// Open the URL in a new tab of the given InternetExplorer instance
ie.Navigate2(url, BrowserNavConstants.navOpenInNewTab, ref m, ref m, ref m);
// Make InternetExplorer visible
ie.Visible = true;
}
