• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

open url

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

0
vbkann
Asked:
vbkann
  • 7
  • 5
  • 4
  • +2
1 Solution
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
 
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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 7
  • 5
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now