accessing internet explorer
hi
i want to make a program that opens internet explorer and open up webpages in that opened instance of IE..it should be able to read the source and send information to it..like form posting...? now i searched up the net but couldn't find the information..maybe i am searching the wrong topics...please help me with this...or atleast tell me what i should be looking for internet programming or DCOm programming or...sth else?
thanks
Re: accessing internet explorer
Welcome to the Forums.
Here is a thread that has several methods that you can use.
http://www.vbforums.com/showthread.php?t=330341
Re: accessing internet explorer
great thread over there rob :) i learned something but still all that is related when u have a webbrowser component in your form....but i don't want to have a webbroswer componet..i want vb to open IE.....and in that opened instance of IE thru either handle or something like that communicate with it...basically do what the code over the other thread does but not in a webrowser component..it should be in an opened IE that the progarm opened..
Re: accessing internet explorer
Here is a quick example of creating a new IE and navigating to a website.
Code:
Option Explicit
Private Sub Form_Load()
Dim oIE As Object
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.Navigate2 "http://www.vbforums.com"
End Sub
Re: accessing internet explorer
thanks rob..i will try this..:)
is it possible to only load the html first..like i don't want any images to be loaded..atleast the one not specified?
Re: accessing internet explorer
I think there was something like that already on the forums. Try a search.
Re: accessing internet explorer
hi....are there any API's for positiioning the IE window?? i want the IE window to open up in a location that i have specified...and also to scroll the page to a desired position...i know it is possible to do by javascript...and in this case by inserting custom javascript into the page, but is there any API or function within VB to acomplish that.
Re: accessing internet explorer
You can use SetWindowPos to position the window and size it.
I think for the scroll you will need to SendMessage to it but unsure how to tell it to go to a particular point.
Re: accessing internet explorer
i am using this
ie.navigate2 "html file"
--> Here ie is a referenced object
now this works fine when i click on the command button again and again and it opens fine but after
closing the opened instance of IE by clicking the close button of the opened instance of IE, and after clicking on the command button i get this error.
run time error '-2147417848 (80010108)':
Automation error
The object invoked has diconnected from its clients.
How do i get around this?
also what is the vb code for double quotation? (for replace function)
sorry for asking in this same forum
Re: accessing internet explorer
Post your code. Are you saying that you get the error when you close IE and then try to create another?
Re: accessing internet explorer
yes rob exactly..
i open and IE instance and then i close it and if again i try to open that then i get that error..
Re: accessing internet explorer
I just tested my code in a Command1_Click event procedure and I was able to open, close and rereate several times. Can you post your code.
Re: accessing internet explorer
Code:
Dim ie As New InternetExplorer
Private Sub Command1_Click()
Dim i As String
ie.Navigate2 "localhost"
ie.Visible = True
End Sub
i am getting the hint that it might be becuz of that global declaration?
Re: accessing internet explorer
Yes, because you are creating it in there too with the "New".
Code:
Dim ie As InternetExplorer
Private Sub Command1_Click()
Set ie = CreateObject("InternetExplorer.Application")
Dim i As String
ie.Navigate2 "localhost"
ie.Visible = True
End Sub
Re: accessing internet explorer