I am trying to refresh a URI in an InternetExplorer tab if it matches another URI.
The issue is that it will not refresh the URI of the IE tab.
So basically, if IE is open, search the URI of each tab and if that URI matches a particular URI then just update it with the new URI and go to that page.
Purpose of this code is code to see if IE is open, if not open IE with the correct URI.
If IE is open then check to see if one of the tabs is already pointed to a CRM page. If pointed to CRM page then just refresh the page with the new data. If IE open but no tab pointed to the CRM page then open new tab.
I have the code working for New IE and New IE Tab.
I just can't the refresh with new URI on Existing CRM page.
ShellWindows sw = new ShellWindows();
for (int i = 0; i < sw.Count; i++)
{
ie = (InternetExplorer)sw.Item(i);
if (ie != null)
{
string url = ie.LocationURL;
if (url.Length >= 30)
{
string urlSubstring = url.Substring(0, 30);
string static_urlSubstring = static_url.Substring(0, 30);
if (urlSubstring == static_urlSubstring)
{
cppExists = true;
string newURL = static_url + "customerNumber=" + CustTextBox.Text;
object m = String.Empty;
object urlObject = newURL;
ie.Visible = true;
ie.FullScreen = false;
ie.Navigate2(ref urlObject, ref m, ref m, ref m, ref m);
Console.WriteLine("After Navigate" + urlObject);
break;
}
else
{
custExists = false;
}
}
}
}