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!

Is there a way to set the caption text to "Internet Explorer"

Status
Not open for further replies.

clear88

Programmer
Nov 29, 2001
24
CN
Hi there,

I am using this code ie.vbs to open a link without the address bar and status bar ( I don't want user to know the web address )

Now, it everything is ok, but just the internet explorer's caption shows address. Is there a way to change the caption to Internet Explorer only?

Cheers

==================== IE.Vbs ===============
Set fso = CreateObject("Scripting.FileSystemObject")
set WshShell = CreateObject("WScript.Shell")
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate2 "'While IE.busy
' wscript.sleep 5
'Wend
IE.StatusText="Please enter your GUID & Password to login in"
IE.MenuBar=false
IE.AddressBar=false
IE.StatusBar=false
IE.Height=480
IE.Width=700
IE.Resizable=false
IE.Visible=True
 
Is it showing the page title?

I mean the part of the HTML between the open <title> tag and the close </title> tag?
 
yes..I want to change the title to "Internet Explorer"

Cheers man
 
Well I've only done that from code within the page itself by setting the value of document.title

If you open a new browser window from inside your page (as in a popup) then you can set document.title of the new window from the original window.

I guess the question is if you can get ahold of the DOM objects from your .VBS and I think that the answer is yes.

So try something like this:
IE.Document.title = "Super Secret Title"


Also, there is another way to change the title permanently but that involves editing the registry and I think you are only describing a temporary change anyway.
 
Sheco, thanks for reply this :D

I tried the code of IE.Document.title = "Super Secret Title", but it doesn't work and prompt an error msg "Unspecified error" and the error code is 80004005

I just want to change it temporary. I have to change the registry DB if there no more solution of this... can u please tell me how to do this in Registry DB?

Cheers man
 
The reason you got the error is that the page has not loaded when the line executes.

The page must load so that the DOM is loaded before you can set its properties.


Try this:
Code:
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate2 "[URL unfurl="true"]http://WWW.GOOGLE.com"[/URL]
'While IE.busy
'    wscript.sleep 5
'Wend
IE.StatusText="Please enter your GUID & Password to login in"
IE.MenuBar=false
IE.AddressBar=false
IE.StatusBar=false
IE.Height=480
IE.Width=700
IE.Resizable=false
IE.Visible=True

MsgBox "Click OK only after page is loaded!"
IE.Document.title = "Super Secret Title"
 
By the way, why did you comment out the While loop that sleeps until the .busy property is false?

Perhaps this code could be used to make sure the document title is not set prematurely.
 
thanks man

but the title shows " - Super Secret Title - Microsoft Internet Explorer"

Huumm...I just want to show "Internet Explorer"

I am using Windows XP Sp2 English version.

Cheers
 
actually I remarked the sleep action. I don;t need to use it, can delete it later..

Cheers
 
IE seems to show the URL in the title bar if you set document.title to either an empty string or a string containing only spaces.

You can set it to "-" so that the titlebar shows "- - Microsoft Internet Exploder"

Code:
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate2 "[URL unfurl="true"]http://WWW.GOOGLE.com"[/URL]
While IE.busy
    wscript.sleep 5
Wend
IE.StatusText="Please enter your GUID & Password to login in"
IE.MenuBar=false
IE.AddressBar=false
IE.StatusBar=false
IE.Height=480
IE.Width=700
IE.Resizable=false
IE.Visible=True
[red]IE.Document.title = "-"[/red]
 
does it work on ur machine?

It doesn't work on my machine...still shows the address ;)

Cheers man
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top