Open url from vbscript

janhoedt
janhoedt used Ask the Experts™
on
Hi,

I would like to open a certain url from a vbscript and found this

http://www.tek-tips.com/viewthread.cfm?qid=1214877

but I cannot seem to make it work.
Any input is welcome.

J.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Chris BottomleySoftware Quality Lead Engineer
Top Expert 2011

Commented:
At it's simplest i'd say:

        With CreateObject("InternetExplorer.Application")
            .Navigate "www.google.com"
            .Visible = True
        End With

Open in new window


Chris
Chris BottomleySoftware Quality Lead Engineer
Top Expert 2011

Commented:
If you want to play with the sizing etc then it's just as easy:

        With CreateObject("InternetExplorer.Application")
            .Navigate "www.google.com"
            .Visible = True
            .Width = 100
            .Height = 600
            .Left = 1
            .Top = 1
        End With

Open in new window


Chris

Author

Commented:
Ok, this (first script) works, thanks! No need for sizing the window.

Now I need to integrate it into an existing script that uses ifmember (not really familiar with scripting), can I use it like this then?

If IfMember("Group") Then
   With CreateObject("InternetExplorer.Application")
            .Navigate "http://url"
            .Visible = True
        End With
Software Quality Lead Engineer
Top Expert 2011
Commented:
Yes ... Ish. As long as URL represents a valid addy then with the following tweak

If IfMember("Group") Then
   With CreateObject("InternetExplorer.Application")
            .Navigate "http://" & URL
            .Visible = True
        End With

Open in new window


URL in this case would be something like "www.experts-exchange.com"

Chris

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial