Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

control caption/title in Internet Explorer

Posted on 2006-10-19
5
Medium Priority
?
184 Views
Last Modified: 2008-02-01
I'm using the following code to open a web browers.  How do I set the caption?

Set objIE = New InternetExplorer

With objIE
   
    .Navigate strURL & "?docs=" & NRTID & "&library=" & NRTLibrary
    .Visible = True
    .StatusBar = False
    .Toolbar = False
    .Width = 630
    .Height = 400
'    .Left = 1158
    .Resizable = False
   
End With
0
Comment
Question by:eshurak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 28

Accepted Solution

by:
Ark earned 2000 total points
ID: 17770479
  While objIE.readyState < 4
      DoEvents
   Wend
   objIE.document.Title = "blahblah"
0
 
LVL 1

Expert Comment

by:siddhant3s
ID: 17798383
Hello eshurak,

Do you know what is the defalt caption of the Page??

I mean, do you know what will be the the Caption of the Internet Explorer.

If yes, I can help you......

The following code will change the caption of the Internet Explorer(or Any other window) if you know what is the Current caption of the Window(like internet Explorer).

Actually, what this program do is that it searches the window with the caption u enter and then when the window is found, it changes its caption to the one you want.

'''''''''''''''''''''''''''THIS IS THE CODE'''''''''''''''''''''''''''''''''''''
''''''''''''''YOU SHOULD HAVE A COMMAND BUTTON NAMED AS COMMAND1'''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Option Explicit
Private Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal _
lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam _
As Long, lParam As Any) As Long
Private Const WM_SETTEXT = &HC
Private Sub Command1_Click()
Dim target_hwnd As Long
Dim target_name As String
Dim new_caption As String

'''''''''''''''''''''''''''''''''''''IMPORTANT''''''IMPORTANT''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' You should enter the orignal caption of the Internet Explorer here.

target_name = "Google - Microsoft Internet Explorer"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

target_hwnd = FindWindow(vbNullString, target_name)

If target_hwnd = 0 Then
MsgBox "Cannot find target"
Exit Sub
End If


'''''''''''''''''''''''''''''''''''''IMPORTANT''''''IMPORTANT''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'This should be the New Caption you want to have....
new_caption = "I have changed the Caption..."
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

SendMessage target_hwnd, WM_SETTEXT, 0, ByVal new_caption
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''





I hope this resolve the issue.
Thank You
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question