Link to home
Start Free TrialLog in
Avatar of pls139
pls139

asked on

Open a browser from VB with supressing the window tilte

Somebody helps me please!!!
Here is my code:
objIExplorer.AddressBar = False
objIExplorer.MenuBar = False
objIExplorer.StatusBar = False
objIExplorer.ToolBar = False
objIExplorer.Visible = True
objIExplorer.Navigate "http://www.test.com/b861200.pdf"

How do I hide the window title?

Many many thanks in advance!!!!

ASKER CERTIFIED SOLUTION
Avatar of vinnyd79
vinnyd79

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pls139
pls139

ASKER

I add your code after the statement:
objIExplorer.Navigate "XXXX"

I found out that the target_name's value is inconsistent,
sometimes it returns value sometimes it returns, I do not know why.
Maybe you need to wait a second after the navigate line.

Try adding this to the declarations:

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


Then add this after objIExplorer.Navigate "XXXX" and see if it helps

Call Sleep(1000)  '1 second
Avatar of pls139

ASKER

I find something new with or without the statement:
Call Sleep(1000)  '1 second

The first time I click on the button, an instance of the browser is open, and pdf file is shown, also an error "Cannot find target" dialog box displayed.

I click on the button second time, another instance of the browser is open, and pdf file is shown, no error message displayed, and the window title of the FIRST INSTANCE OF THE BROWSER IS SUPPRESS!!!

I click on the button third/fourth/fifth... time, another instance of the browser is open, and pdf file is shown, no error message displayed, and the window title of the SECOND/THIRD/FOURTH... INSTANCE OF THE BROWSER IS SUPPRESS!!!

what should I do?





Avatar of Richie_Simonetti
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long

setwindowtext objIExplorer.hwnd,vbnullstring
well nearly everything was right except u should use the objIExplorer.Navigate2 function instead of objIExplorer.Navigate
Hi pls139,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept vinnyd79's comment(s) as an answer.

pls139, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Per recommendation

RotaredoM
CS Mod @ EE