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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell Command 2

Status
Not open for further replies.

Wiszh

Programmer
Aug 3, 2000
134
US
How can I use the shell command to open a web page from a button click?
 
Set the HyperlinkAddress property of the command button. That should do it.
 
I'm working with Access 97 which does not support the HyperlinkAddress property.
 
You could try using the ActiveX control "Microsoft Access Web Browser" (it's pretty cool). Assuming you name the ActiveX control "ocxWeb", then in the OnClick event of your command button, do this:

Me.ocxWeb.Navigate "path of web page"

Note that the ActiveX control is embedded in your form. May not be what you want, but...
 
Say you have a text box control called WebAddress and a comand button on a form.

Enter in the text box.

Then in the Click event of the command button:

Application.FollowHyperlink Me![WebAddress]

Hope that helped!

Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
I was hoping to open the browser externally not to have to create a form that has a browser embedded in it.

Thanks
 
Application.FollowHyperlink will open a browser window.

Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Thanks ajdesalvo that's exactly what I was looking for.

My apologies FancyPrairie, you are correct I could have used the HyperlinkAddress property in Access 97

Thanks again


Wiszh
 
try this...

'declare a variable.

Dim mywebsite As String

'before you specify what site to open, you have to specify the proper exe.
you should have an exe that kicks off your web browser and it's stored somewhere within your C: drive. locate it (you can go to Start - Programs - right click on Internet Explorer - go to Properties - go to the Shortcut tab and it should tell you where the target is) and include the proper path (target) where i've got C:...etc below, then include a space, and then the name of the site you want to go to, in the example below it's http:\\ Enclose from C: over in quotes like below.

mywebsite = "C:\Program Files\Internet Explorer\IEXPLORE.EXE http:\\
'perform the call that makes it go.
Call Shell(mywebsite, 1)

the end result should look like this:

'''''''''
Dim mywebsite As String

mywebsite = "C:\Program Files\Internet Explorer\IEXPLORE.EXE http:\\Call Shell(mywebsite, 1)
'''''''''

did this work ok? hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top