Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bring Internet Explorer to Top

Status
Not open for further replies.

FrankMars

Technical User
Dec 20, 2010
67
0
0
US
Hello. I am able to open Internet Explorer and Outlook with the following code on a button on my form;

Code:
Dim X As Variant
Dim Y As Variant

Dim Path1 As String
Dim Path2 As String
 
Path1 = "C:\Program Files\Internet Explorer\iexplore.exe"
Path2 = "C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE"

X = Shell(Path1, vbNormalFocus)
Y = Shell(Path2, vbNormalFocus)

When I navigate away from those windows back into Access, I would like to have a button to bring them both back to top. My code for this is;

Code:
WinToTop "Microsoft Internet Explorer"
WinToTop "Microsoft Outlook"

Outlook comes to top but Internet Explorer does not. How would I get Internet Explorer to come to top also? Thanks very much in advance.



 
I've only rarely tried to connect to other windows outside the Office applications via VBA. But I remember one way was to search through the active windows for what I'm looking for.

This seems like it could get there:

What I would try is looping through the windows, looking for a string that's part of the name, for instance, "Internet Explorer". Once it reaches that field, then trigger your other code.

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top