Question

3
Replies
204
Views
Sabarirajan Member since 2017 11 posts
standard chartered global business services
Posted: February 4, 2019
Last activity: February 5, 2019
Closed

Close New Opened TAB in Internet Explorer 11

Hi,

we can close the new Opened tab via C# script.

add COM reference -- >Microsoft Internet Controls

using SHDocVw;

ShellWindows _shellWindows = new SHDocVw.ShellWindows();
string processType;

foreach (InternetExplorer ie in _shellWindows)
{
//this parses the name of the process
processType = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();

//this could also be used for IE windows with processType of "iexplore"
if (processType.Equals("iexplore") && ie.LocationURL.Contains(@"identity")) // PASS the url contains instead of "identity"
{
ie.Quit();
}
}

orelse

we can use the Close Window method and we need to interrogate the "Close Current Tab" or "Close All Tab" option to continue further.

Robotic Process Automation
Moderation Team has archived post
Share this page LinkedIn