open url

How can i open a url using the api..or open internet explorer invisibly at a certain url?

LVL 1
vbkannAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

boycyCommented:
by far the best way is to use the SHELL "START..." command. This will open any document with its registered application, eg
SHELL "START HTTP://WWW.EXPERTS-EXCHANGE.COM"

or

SHELL "START MAILTO:BOYCY@VISBAS.8M.COM"
(my address)
0
mark2150Commented:
Conversely you can drop a Web control onto your form and open any URL you want. My web page has a limited functionality browser (including source) for this specific application. Visit:

www.cyberchute.com/rvbus/madmark

M
0
vbkannAuthor Commented:
i want to open a page invisibly though, or a url invisibly. ie with no screen showing the actual page...but i have been there.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mcriderCommented:
You can add the WebBrowser control to you application and hide it on the form.

To add this control to your form, right-click the toolbar and select "Components..." then select "Microsoft Internet Controls" from the list.

Add a WebBrowser control to your form and then set the VISIBLE property of the control to FALSE.

You can then go to the site using:

   WebBrowser1.Navigate "http://www.experts-exchange.com"


Cheers!
0
vbkannAuthor Commented:
im sorry...but i dont want a control unless it comes with windows as standard.

However..if i reference this webcontrol..and i do the following code..it doesnt work..why is this?

Dim i as InternetExplorer
i.Navigate "Http://www.msn.com"

if i run this code i get an error saying "object variable or with block variable not set"

If i change my code to:

Dim i As Object
Set i = New InternetExplorer
i.Navigate "http://www.msn.com"

No error messages come up, but this doesnt work.

How can i get this control to work by referencing it and does it come standard with windows?
0
mcriderCommented:
You have to add the Microsoft Internet Controls Reference to your project (SHDOCVW.DLL).  It is a part of Internet Explorer 3, 4, and 5. One of these versions of IE must be installed to use this reference.


Cheers!
0
mcriderCommented:
By the way,

Dim i As Object
Set i = New InternetExplorer
i.Navigate "http://www.msn.com
i.Visible = True

will show the browser window.


Cheers!
0
vbkannAuthor Commented:
mcrider..if i dont have the visible set to true...it wont actually go to the url.

How can i get it to go to the url invisibly?
0
vbkannAuthor Commented:
im sorry...but i need a way to do it invisibly
0
mark2150Commented:
What is point of invisible navigation? There's no real point in rendering a web page if you're not going to *see* it. Or are you just trying to drive up the "hit" counters?

It *does* gen the page even when not .Visible. Try my code and set the controls visible property to FALSE and then set it to true in the "Navigate Complete" event. *pow* the page will appear as all of the data is pulled down. The Document_Complete event doesn't fire until after it's rendered but the navigate complete should.

M
0
mcriderCommented:
It does generate a page hit if visible = false...  I have tried it on VB4 and VB4 using IE4 and IE5.

Cheers!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mark2150Commented:
Hey mcrider!

You've parroting my responses as answers on this Q *TWICE*!

M
0
mcriderCommented:
mark2150, No I have not parroted your responses...
   Nowhere do you mention hiding a webcontrol on the form.
   Nowhere did you actually post code.
   My last post was a response to my rejected answer.
   Nowhere did you mention trying the code on different versions of VB and IE.
0
vbkannAuthor Commented:
But i have you tried doing it through adding the webcontrol in the references...not the custom controls.

Mine works when i add it in as a control...the ocx. But when i only add the reference to the dll...and i navigate to a url..it doesnt work..it doesnt generate a 'hit'

have you tried this...
0
mcriderCommented:
I just tried it as a reference and as a control. They both work on my systems.  I tested both WIN95 & WIN98 using IE5 and VisualBasic 5 SP3...

What versions are you using?
0
mark2150Commented:
mcrider,

My comment:
Conversely you can drop a Web control onto your form...

Your Answer:
You can add the WebBrowser control to you application...

My comment:
It *does* gen the page even when not .Visible...

Your Answer:
It does generate a page hit if visible = false...

These are not "race" conditions were we both posted at the same time. Time stamps on the responses show *hours* between posts.

You said I never actually posted code. Well in my *FIRST* comment I pointed him to my web page where there is a FULLY OPERATIONAL AND TESTED project with *ALL* source - not just little 4 line snippets!

You should TAKE THE HINT when your *first* answer is rejected and DO NOT lock the Q again until invited or the points are awarded using "Accept Comment as Answer". You've been cautioned on E-E ettiquite before...

M
0
vettrangerCommented:
Mark2150, I'd recommend writing this up to Customer Service. I'd say more but I've promised Linda that I wouldn't upbraid this party on Q lines anymore. Frankly, I got so tired of their 'one more chance' for this individual that I completely lost my taste for this site.
0
mcriderCommented:
mark2150,

Like I said:

1) The customer wanted invisibly. Nowhere do you mention hiding a webcontrol on the form.

   You said "Conversely you can drop a Web control onto your form and open any URL you want."

   I said "You can add the WebBrowser control to you application and HIDE IT on the form."

   Don't paraphrase and leave out critical information to *support* your *claim*.


2) Nowhere did you actually post code. Other people may buy the answer to a question.  Webpages come and go, but if code is posted as an answer, there is no question.


3) My last post was a response to my rejected answer. vbkann asked questions of my rejected answer, which I responded to... and specifically asked OF ME:

    "mcrider..if i dont have the visible set to true...it wont actually go to the url."

JUST BECAUSE YOU JUMPED IN TO ANSWER, DON'T ASSUME I COPIED YOUR ANSWER!


4) Nowhere did you mention trying the code on different versions of VB and IE.


vbkann, please accept my apology for this string.
   


0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.