vbscript code to launch web page

G

GaryM

Help
I need to launch a web page using a button control from an infopath form.
Can anyone help with the vbscript
Thanks
GaryM
 
S

Scott Roberts [MSFT]

There may be other ways but one way to do this is to use CreateObject with
InternetExplorer.Application. Then you can navigate to a web page using the
IE object model. Since you are calling CreateObject, your form template will
need to be in full trust mode.

Here is rough pseudocode:

Dim IE As ShDocVw.InternetExplorer
Set IE = CreateObject("InternetExplorer.Application")

IE.Visible = True
IE.Navigate(http://foo.com)

There is more information about the InternetExplorer object in MSDN.

There are various other ways to do this but this is the first one that comes
to mind. One other way would be to use the Shell object's ShellExecute
function. However, each of these solutions involves an ActiveX control which
means that your solution will need to be full trust.

- Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top