Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Multiple WebBrowser Objects On One Form.


Well, now I seem to have another problem. Look at this code:

' Look for a certain string in an html document (searches the WHOLE doc)
Public Function LookForStringInDocument(cw As WebBrowser, lookFor As String, offset As Integer) As Boolean
    Set hel = cw.Document.body
     
    If Not (hel Is Nothing) Then
        If InStr(hel.innerHTML, lookFor) <> 0 Then
            LookForStringInDocument = True
            Set hel = Nothing
            Exit Function
        End If
    Else
        LookForStringInDocument = False
        Set hel = Nothing
        Exit Function
    End If
     
    LookForStringInDocument = False
    Set hel = Nothing
End Function

Trying to call it like this:
     If LookForStringInDocument(WB2, "You are not", 0) = true then
          MsgBox("We could not log on to our website!")
     End If

It seems that, when I pass the WB browser object (the webbrowser object doing the most work, the "primary" one on the form) to it, it works fine. But for the second web browser on my main form, it works approximately 1/10th of the time. It makes no sense as to why it would work fine sometimes, and not work the others. I have the page loaded in the second WebBrowser object (WB2), but it seems that it doesn't find the string. Yes, it is ghetto code, but it works for my purposes. I do not know why it would be working half-ass. Maybe someone can clarify for me? Thank you in advance.

- Brandon Erhart


"Inform all troops that communications are down!"




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Locating Form Objects With Webbrowser Component
Hi all,

This small problem has been annoying me for the past few weeks. I have a webbrowser object in a VB 6 program. I have it set so it will go to a particular page and fill out the form(s) on the page with information I give it. Right now I basically fill out text boxes and check checkboxes by the code:

test.Forms(0)(1).Value = "Data goes here"
test.Forms(0)(2).Checked = 1

However, on a particularly large site or one that is updated frequently, these form object positions (such as 0, 1) change frequently when new forms are added. For that reason, I am wondering if there is an easy way to search for text fields, buttons, etc. by name or value for instance? Right now I have to keep guessing until I get the form component correct, and it becomes a nightmare every time the site changes!

Thanks in advance!!!

Objects In Webbrowser Control
how would i detect when all visible objects are loaded in the webbrowser control... not the images, just objects such as the textboxes and command buttons... detecting when webbrowser1.busy = false is to slow in my case since the page that is loading calls an iframe from a slow server.... i just need to know when the webbrowser is ready to accept user input.... not completely loaded

WebBrowser: Converting Strings To Objects
I give...

Keep getting Error '91'

I'm trying to auto populate a Web form via the WebBrowser component, but creating a variable number of fields to populate has become frustrating. Why doesn't this work and how do I do this correctly?

'GET SOME RECORDSET
set rsMyRecords = conn.execute(cmd)

icount = 1
Do While Not rsMyRecords.EOF
strWebFormField = "FieldNumber" & icount
WebBrowser.Document.All(strWebForField).value = rsMyRecord("COL")
icount = icount + 1
rsMyRecords.MoveNext
Loop

---------------
The RED is where I'm getting the error. I have tried many ways, but no luck. Can someone throw me a bone? Thanks!

--Leslie

Hooking Events For All Objects In WebBrowser
I found out how to hook the various events of objects like Document. What I can't figure out though is how to assign event handlers to every object (like a handler to show a context-menu). In other words requiring event handlers assigned at run-time.

Stupid VB can't do WithEvents with arrays of classes, so that didn't work.

Any ideas?

WebBrowser: Accessing Embed Objects In A Web Page
Lo,

I would like to access to a embed object into a web page (to play or to stop).
I load the web page into a webbrowser object and try to find embed objects in the document object.

Embed tags are often (always ?) included into a <OBJECT> tag.
<OBJECT>
param...
<EMBED>
</EMBED>
</OBJECT>

I can find the OBJECT tag, but i'm unable to find the <EMBED> tag, either:
. directly in the page, by this way:
MyWebBrowser.Document.All.tags("embed")

. or inside the OBJECT tag (childnodes).

Anyone's got an idea
Many Thx

WebBrowser Control And Document Objects Lookup Issue In VB
Hi, there

I have tried to use WebBrowser Control in VB for some automation.

The problem I have is with the Document Objects lookup.

3 syntaxassume the form name is "abc", VB string variable FormName="abc"

msgbox WebBrowser1.Document.Forms("abc").Name
msgbox WebBrowser1.Document.abc.Name
msgbox WebBrowser1.Document.Forms(FormName).Name

the first two syntac works fine. but the third one never works...

I wonder what cause this and how to fix it.

The reason why I need to use a string variable is because I won't be able know the form name before runtime, and I certainly don't want to go through all Forms() collection to compare one after another to find the right now.

Another issue is that it seems there is no way to establish VB to VB callback style sub or function, right?

thanks in advance,

edmond

Adding Objects (pictureboxes, Graphs, Etc...) To Webbrowser Control
I have a graph (from a thirdparty OCX) that I want to be displayed in my webbrowser control... how can I do this, is it possible?

Working On Multiple Objects
How to work on multiple objects - for example, having several textboxes, how to change their text field using one call/loop?
They are named Text1, Tex2, etc.

Wait For Multiple Objects
Hello all,

I am using waitforsingleobject(API) to wait for one application/process. But my problem comes when I my called application starts second process. At that time my application hangs. I tried with waitformultipleObjects but that is not working properly.

Thanks in advance

Multiple ADO Recordset Objects
Hi,

I have a situation where many procedures of a form are using a ADO connection declared under the General section of the form code:


Code:
Option Explicit

Dim db As New ADODB.Connection
Dim rst As New ADODB.Recordset
.................................
.................................
Now inside one of the procedures I need to define a separate recordset object,say "rst1" using the same connection object "db".

Do I need to use the 'NEW' keyword to create a new instance of the recordset object variable inside the procedure or is it not necessary to use 'NEW'?


Code:
Private Sub readdata()

Dim rst1 As New ADODB.Recordset


or,


Code:
Private Sub readdata()

Dim rst1 As ADODB.Recordset


Which of the two should I use & why?

Thanks in adavnce.

Multiple Objects Under One Roof
I have multiple objects, which form part of another object. For ease of understanding, they are

Mailing - which is the main object.

...and

AddressData - which holds company name, street details etc.
ExtdAddressData - which holds salutation, first name, surname, country etc.
MailsortData - holds details of what zone the address is going to, etc.
Baglabel - holds details of number of addresses to certain locations.

My app adds addressdata to the AddressData and /or ExtdAddressData object(s) and adds the filled object to the Address object(s) held in Mailing.

Question - Instead of having to set each object to other objects each time, how can I add a main class so that all I have to say is something like


Code:
Set AddressDetails =Mailing.AddressDetails

Multiple Objects Equals....
Can I make more than one object get the same value like:

Text1.Text, Command4.Caption = "Test"

Now I know this doesn't work, but can it be done?

Coding Multiple Objects
Hi

I have the following code:

Private Sub txtStud7_AfterUpdate()

'//To make the Jamb Width change according to:
'//Stud Width and Jamb Profile

'DEFINE VARIABLES
Dim JAMB As Integer
Dim stud As Integer

'INPUT

stud = Int(txtStud7)

'PROCESS
'If Profile is Architrave, then Jamb = Stud + 22
'If Profile is Grooved, then Jamb = Stud + 45
'If MUF Grooved, stud 70, then Jamb = Stud + 51
'If MUF Grooved, stud 90, then Jamb = Stud + 52

If stud = 0 Then
MsgBox "Please enter required Jamb size", vbExclamation, "Enter Jamb Size"
JAMB = 0
txtJamb7.SetFocus
GoTo 16

ElseIf comJMaterial = "Pine" And ComJProfile = "Flat" Then
JAMB = stud + 22
ElseIf comJMaterial = "Pine" And ComJProfile = "Grooved" Then
JAMB = stud + 45
ElseIf comJMaterial = "MUF" And ComJProfile = "Flat" Then
JAMB = stud + 22
ElseIf comJMaterial = "MUF" And ComJProfile = "Grooved" And stud = 70 Then
JAMB = stud + 51
ElseIf comJMaterial = "MUF" And ComJProfile = "Grooved" And stud = 90 Then
JAMB = stud + 52
ElseIf ComJProfile = "Flat" Then
JAMB = stud + 22

End If


'//Reminds user to change Jamb size depending on lining type
If vbNo = MsgBox(prompt:="Jamb size is based on 2 layers of 10mm Gib - Okay?", Buttons:=vbYesNo + vbQuestion, Title:="Confirm Lining") Then
MsgBox "Please alter Jamb size accordingly", vbExclamation, "Change Jamb Size"
JAMB = 0
End If

'OUTPUT
txtJamb7 = Str(JAMB)
txtJamb7.SetFocus
16
End Sub


It works how I want it to, but the problem is that I have 26 each of the txtJamb* and txtStud* boxes. Every time I make a change I have to change 26 pieces of code. The only difference between each one is the number at the end of the txtJamb* and txtStud* boxes. Is there a way to write one piece of code for all 52 boxes?

Thanks

Opening Multiple Com Objects
I have a NT service written in VB, I want this service to monitor several mail boxes and when new mail arrives call a COM DLL or EXE to deal with the incoming mail. Each mailbox may have its own Dll or Exe registered with MTS.
I am a web developer and I am quite new to VB so the following question may be somewhat trivial:

Question

Can the VB service call a COM object and let it run without having to wait for it to finish. I already have used COM objects from a mail agent but these wait till the COM object has finished executing before it can move on. The COM object will have their own error handling.

I know VB is not truly multithreaded but is it still possible to have multiple Com objects opened from the same service and executing at the same time, even if this does mean CPU sharing in VB.

Thanks,
Sean Martin

How To Make The Webbrowser Control (and Just The Webbrowser In My Form) Offline?
wb.Offline = True
wb.Navigate "www.excite.com"

wont work.. itll still load excite (or any other site, doesnt matter if its cache or not)

anyone know how to prevent this?

also, how can you stop that errorbox saying 'cant load page because browser is offline' with the 2 options saying 'connect' or 'stay offline'? i dont want it popping up dozens of times when i try to visit a site in the webbrowser

Drag And Drop Multiple Objects
I am trying to write some code that selects a number of image boxes and drags them all together to be dropped to another portion of the form. I have set drag mode to manual and tried to start the drag in the following way...

For i = 0 To UBound(selected)
Imageshadow(get_index(selected(i))).Drag vbBeginDrag
Next i

However, this seems to only initiate the drag on the last of the arrays cycled through. Does anyone know how to do this properly? Or know of a tutorial where this is done?

Problems With Textures On Multiple Objects
Hi
I have been studying the tutorials at http://www.directx4vb.com/ and I have been looking at creating keyframe animations in directx 8.1. I have tried to modify the code on lesson 10 to do multiple objects, but cannot get the textures to be applyed to any other object that my first one. Please view my amendments and tell me where I am going wrong.

A Sub That Handles The Same Event For Multiple Objects
Is there a way to do this, for example, when you have a series of text boxes, and whenever anyone of them gets focus, it runs a counter. Is there a way to write

Private sub LostFocus()
counter=counter+1

end sub

without having to write a

Private Sub Textx_LostFocus()
counter=counter+1
End sub

For every object?



thanks

Any Wat To BitBlt One Image Onto Multiple Objects?
Lets say I have four PictureBoxes. All are exactly the same. Is there a way to draw the image so that its center is in the center of the four pictureboxes? I am using the trick where you load the image into an imagelist, set the mask, then redraw it onto the target object.

Format Multiple Mshflexgrid Objects
Hello. I want to format 12 diferent mshflexgrid with the same style. Can I do that using a procedure or do I have to format each object ?
Thanks

Changing The Properties Of Multiple Objects At Once
I want to make multiple controls enabled at once, say using a loop.


VB Code:
Dim x As Integer Dim objects() As Variant objects(0) = "cmdGo"objects(1) = "cmdReset"objects(2) = "cmdClipboard"objects(3) = "txtInput"objects(4) = "cmdUnits"objects(5) = "lblOutput"objects(6) = "fraMain" For x = 0 To 5        If objects(x).Enabled = True Then    objects(x).Enabled = False    End IfNext x

I done something like that above but have had no luck. Could someone please teach me how to get it working.

Alternatively, is there a simpler way that you can make all the controls within a frame enabled at once?

Load Multiple Objects At Runtime
i know this question has been answerd alot of times, but i cant find any of those when searching, so...how do i load for example alot of commandboxes at runtime?

Applying Fonts To Multiple Objects
I have an application with like 100 different textboxes, listboxes, lables on about 5 different forms. Is there any way to change the font size, name, and etc. with the common Dialog control without having to list each individual textbox, listbox lable etc???

How To Reference Multiple Excel Objects
Hi
Had a question on how to reference multiple excel objects?

1.Open Excel file1
2.read it
3.open excel file 2
4.read it
5.close excel file2
6.now access excel file1 object
Step 6 Fails
I am using the following functions for open and close excel
(objexcel,objworkbook & objworksheet are global variables)
public sub OpenExcel(sFileName)
{
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Open (sFileName)
Set objWorksheet = objWorkBook.WorkSheets(1)
}
public sub CloseExcel(sFileName)
{
Set objWorksheet=Nothing
set objWorkBook= Nothing
'Kill the instance of excel object
objExcel.Quit
Set objExcel = Nothing
}


Selecting Multiple Objects In Code
as an output, if i want many objects to become disabled can i write the code for:

Image1 - Image78.enabled = false
Text2 - Text 6.visible = true.

Basically, i want to be able to write code for multiple objects that do the same output without having to write:

Image1.enabled = false
Image2.enabled = false
Image3.enabled = false...

etc etc etc.

Cheers

Controlling Multiple Objects With A For Loop
Is there a way to create 5 texboxes and then control how many are enabled by using a comboBox?

I.E.
Code:
Dim Counter
Dim myVariable

myVariable = comboExampleComboBox.listindex

For Counter = 1 to myVariable

txtExampleText(Counter).enabled = False

Next


This code doesn't work, but it encompasses my idea. Any help would be greatly appreciated! Thanks!

-----------------------------
looks like another bug...

Multiple Instances Of Com Objects Hangs VB
Hi,

I am working on python and VB. I have a com server on python which is a drawing application. I create an object in VB to start the application when I click on the menu in the form. If at a time only one instance of the application is crated then it works properly. If I open multiple instances of the application without closing the previous windows then also everything works fine until I close the MDI Form. When i close the MDI Form, the MDI Form closes but VB hangs.

Private Sub mnuHi_Click()
Dim a As Object
Set a = CreateObject("Python.Dhruv")
a.make
Set a = Nothing
End Sub

How can I prevent this??

Dhruv

Substitution Parameter For Creating Multiple Objects
I'm using the header fields from a csv file and a collection of User attributes from Active Directory to create a mapping form displaying the array of csv fields in one column and list boxes of the collection in the adjacent comlumn.

I want to programatically generate list boxes, each one with a suffix value that corresponds to the array index number for the csv column. So what I need to figure out is if there's a substitution parameter available in VB 6.0 that will read the counter variable in a For loop as a literal value.

Here's the concept in rather abbreviated logic
csvlist = ubound(csvfields)
For a in csvlist
Dim Listbox_"a" as Listbox 'Give index suffix so you create the temp objects
'Listbox_1,Listbox_2...
For Each ADattr in Usrattr.collection 'repeat
Listbox_"a".additem ADattr.name
Next
Next

The intention is to provide flexibility to the form, as there could be varying numbers of header fields (20 to 30), so that the corresponding column pairs:
csv_header = listbox_value can then be written to a configuration file.

Thought this would be the easiest way to map a group of fix values to anothe r (the AD User collection) that has dozens of possible selections.

Failed To Create Multiple Word Objects VB6
Hi Everyone,


I'm working on a VB6 program which will process a selected word document. Anyway, I want to allow the users to work on some other MS word documents when the process is running. Because when i run my program, the process will take about 20 mins to finish, it's illogical to have the user waited for 20 mins without working on other Word-related works. I want the user to be able to multitasking.The problem i'm having now is when the user opens a another word document from Window Explorer, I get an error, because my program is trying to perform the actions on their selection on new opened word document.


So, is there anyway to ensure a new Word instance will be created when the user open another word Document? As you can see from the Task Manager, under normal circumstance, no matter how many word documents you open, only one "WINWORD.EXE" instance is being created and shared. I believe my problem will be solved if every word document opened is accompanied by a new Word object created.


The following is a small part of my code to create the Word object



Dim wrdApp As Word.Application
Dim wrdDoc As New Word.Document
Dim tempApp As Word.Application


If TypeName(wrdApp) <> "Application" Then
Set tempApp = CreateObject("Word.Application")
Set wrdApp = CreateObject("Word.Application")
tempApp.Quit

Set tempApp = Nothing
End If


Set wrdDoc = wrdApp.Documents.Open(filePath)


Any help would be deeply appreciated. thanks..

Using Multiple Printer Objects To Print To Two Printers In VB App
I am trying to direct printer output to two different printers within the same app. In the end I need two printer files, one to a color printer and the other to a b&w one (the printing is done commercially, so we need to do this to save $$s).

Can I create a second printer object and then do something like this:

Printer1.print "text"
Printer2.print "text"

I have tried a few things to create these objects, but they don't seem to be working.

Thanks for the help.

Resolved - Multiple Objects Controlled By Same Code
If this turns out to be easy, I'm gonna shoot myself!

Here's the scenario...

I have an App (a good start?)

This app has several forms.

Virtually every one of the forms though has an object on it (a frame, but, I think irrelevant).

At various times when running the app I want to do stuff to the frame (move, colour etc) on the form with focus.

Is there ANY way I can put the code to do this (some of it is quite extensive) into a module and simply pass the form I want it to work on THIS time to the code so it works on the correct form.

I simply do not want to have 10 copies of identical code in my app.

Any thoughts??

Hope this makes sense!


Thanx in advance.


Pigmy

Sending MAIL To Multiple Receipients Using CDO Objects
Hello,

I am using CDO objects for my EMAIL application. I want to send a MAIL to multiple receipients using then ( cc - carbon copy , bcc - Bi Carbon copy ) facilities.
I have provided two text boxes where user can enter several mail account names. I had written the code but it is not performing the activity what I wanted. It is taking
all the mail accounts along with the Main Receipient ( To mail Id ) in one line and the CC and BCC are left empty.

Code which I had written is as below

Set objRecipients = ObjMsg.Recipients

' This is for the main receipient to whom the message is to be sent
Set objOneRecip = objRecipients.Add

With objOneRecip
'Fill in an appropriate alias here
.Name = Me.TxtToMail.Text
.Type = ActMsgTo
.Resolve ' get MAPI to determine complete e-mail address
End With

Can u tell me how to change the logic for both CC and BCC

Regards

Prasad

(kpra24@hotmail.com)

How To Connect Events Of Multiple Objects To One Event Handling Function?
Hi, Gurus
Please help me with this. I've been doing research for a few days but haven't got a solution. In my case, I need to create several objects of the same type. The object generates a few events need to be handled. I need to create the objects dynamically at runtime.

Now is my question. How can I connect the events with the event handing functions using WithEvents? With WithEvents, I can connect the event of a particular object with a function at design time. But I need to create the object at runtime.

I know with control array I can trap events generated by multiple objects with only one handler. (sorry, I don't know how to name the variable declared by WithEvents) But it seems to me control array only handle activex components. May I create control array at runtime? I am quite confused.

Sorry for so many questions. I was mainly working in C++ before and haven't been adjusted right for VB yet. But I have to work out the project on my own with tight schedule. If someone can help me out, I really appreciate that.

VB Code And Form (&& Objects One Form) Out Of Sync - Refresh Problem
Here's a strange problem
Visual Basic 6 Pro & SP5 running on Windows XP Pro (2600)

a few forms and a few code modules (.BAS's)

in Module1

Code:
Public Sub PlayTrack(TrackID As Integer, i_frmMain As Form)

' Increase the play count for this track
' Load track into the player
' update the status on the main form
P_MusicCatalog(TrackID).PlayCount = P_MusicCatalog(TrackID).PlayCount + 1
With i_frmMain
.lblStatus.Caption = _
"Now playing " & Trim(P_MusicCatalog(TrackID).mTitle) & _
" by " & Trim(P_MusicCatalog(TrackID).mArtist)
.lblStatus.Refresh 'Try refreshing the label
doevents 'Give the system time to do anything else
.refresh 'refresh the form
.wmpPlayer.Open (P_MusicCatalog(TrackID).FName)
End With

End Sub


On the main form (frmMain) I have some code that calls PlayTrack accordingly
The problem is that when looking at the lblStatus label on the form it still displays the caption that was set at design-time
I know that the code has excuted because the two Debug.print items appear in the Immediate window
Also calling:
MsgBox frmMain.lblStatus.Caption

displays a MsgBox with the next "Now playing <track name> by <artist name>"

I've since noticed that the same bug occurs when calling frmMain.caption

Also moving the code to the actual form that it affects (frmMain) has not effect

If I create a new, blank project with a module & form then it works correctly.

If I call frmMain.printform then the printed copy of the form is updated correctly, but the copy on screen is still incorrect.
Any Ideas?

Creates A New Form During Run Time, And Copies Objects Over From An Existing Form.
Hi,
Is it possible to
Creates a new form during run time, and then copy objects over from an existing form onto the new form?
Thanks.

Disable Objects On Form And Closing Previous Form
1st :Let say i have many textbox and combobox on the window form. Then i want to disable these objects by writing the short
       code. i dont want to repeat: "texbox1.text.visible= true" What can i do?

2nd: I have two window forms. On first window form, i create one button to open the 2nd form. But i cannot close the first form.
       I just can hide it. How can i close the first form?

 I am just a beginner of VB language so please explain me as beginner level. Thank a lot for your reply!

Navigating Through Multiple Forms With Webbrowser
I am trying to navigate through multiple forms with webbrowser control - I can get through the first form, but how do I enter information into and submit the subsequent forms?

Here is the code I am trying, it only gets me to the first form.

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)

'CODE FOR LOGGING IN TO MAIN COURT SITE
If InStr(WebBrowser1.LocationURL, "login") Then
With WebBrowser1.Document
.All("login").Value = "sr0245"
.All("key").Value = "cmp1234"
End With
DoEvents

WebBrowser1.Document.Forms(0).submit

'CODE TO GET TO DOCKET
With WebBrowser1.Document
.All("case_num").Value = "01-16034"
End With
DoEvents

WebBrowser1.Document.Forms(0).submit

End If

End Sub

Printing Multiple Files From WebBrowser - Help!
Hi everyone:

I have a VB6 app from which I would like to print multiple HTML files from the hard disk. I am trying to use the WebBrowser control but have been unsuccessful in getting it to print multiple files (using a loop that includes a Navigate followed by an ExecWB Print). I've fiddled with it any number of ways but have never been able to reliably print all of the files I request.

Does someone out there have a simple working application that does this?

Alternately, if someone could tell me how to suppress the print dialog box generated by the SHellExeceute Print command, that might work just as well.

In any case, thank you for any and all insights!

Joe Harvat

WebBrowser Multiple Login Problem
I have an application that creates an array of WebBrowser controls. Each WebBrowser is used to login to a different account. As long as I direct each instance of WebBrowser to a different URL, the program works fine. If I try to login to different acounts that reside at the same URL, the WebBrowser simply uses the data for the original account at that URL, and logs in to the first account for a second time.

Does anyone know how I can overcome this? There must be a way of telling the WebBrowser that I need to use new and different login parameters. As it is, the login is simply bypassed and my program has no ability to modify the login account.

Thanks for any help

Help With Multiple Printers With Webbrowser Control
Greetings,

I am trying to print to multiple printers with the
webbrowser control. For example, web page #1 goes to printer A, web
page #2 goes to printer B. Note that the printer names are read from a
data file, so no user input is allowed. I am using the following code from the
Knowledge Base to print from the webbrowser:

WebBrowser1.ExecWB OLECMDID_PRINT, 2

Is there a way to specify a printer with that code? It just prints to
the Windows (not application) default printer. Since I can't specify a
printer, I am trying to change the Windows default printer before I
print each time using this code from the Knowledge Base:

WshNetwork.SetDefaultPrinter CStr(PrinterName)

The problem is, this works on my machine, but not on my client's
machine.

Is there another way to print to multiple printers from the webbrowser
control? Failing that, is there a reliable way to change the Windows
default printer in VB?

Thanks in advance for the help,

Joe

Help With WEbBrowser Component And Multiple Submit Buttons
I am using the WebBrowser component trying to simulate click a button. I was trying to use
Code:
WebBrowser1.Document.Forms(0).Submit
which did not work after much searching I tried
Code:
WebBrowser1.Document.Forms(0).Item("north").Click
Neither of those worked. THe button I am attemting to press is a submit button north the html code where it is found is :
Code:
<form action="index.php?do=move" method="post">
<center>
<input name="north" type="submit" value="North" /><br />
<input name="west" type="submit" value="West" />
<input name="east" type="submit" value="East" /><br />
<input name="south" type="submit" value="South" />
</center>
</form>
any help would be apreciated

Handling Multiple Buttons Thro' Webbrowser
Hello,

I have a webpage with multiple buttons. They all have the same type. Example.

input type="submit" name="Attach.x" value="Attachment" onClick="onSubmitCompose(0);"
input type="submit" name="Dictionary.x" value="Dictionary" onclick="onSubmitCompose(0);"
input type="submit" name="Thesaurus.x" value="Thesaurus" onclick="onSubmitCompose(0);"

WebBrowser1.Document.Forms(0).submit.Click
This does work if the page has only one single submit button, but doesn't work in the above case.

Now I am trying to click one of this button in my VB code, which has a webbrowser component and it doesn't work. Can you guys help me as to how I could do this ? Thanks so much.

Regards,
Vinay

Printing Multiple HTML-Documents Using WEbBrowser Control
Hello !

Iīve got the following problem. In a VB-Program ( Version 6 ) I need to print multiple HTML and XML-Documents.

This should happen in a loop above the desired documents ( all available on harddisk !) . But there are a lot of problems using the webbrowser control. only one object of the control is instantiated cause the loop can contain up to 10000 documents , so that an initialize of one Browser-control for each doc will soon stop the computer from doing anything.
In this loop I navigate to the doc then give the execwb OLECMDID_PRINT.. command... wait for Readystate = READYSTATE_COMPLETE close the document and walk to the next document...
But it doesnīt work. Not every document is printed or the Explorer is closed before all docs are printed or no doc is printed .... and so on..

I know that the browser creates a second process to print the doc , so I tried it with waiting 1st for the message IE_DocumentComplete and the win_onafterprint. but still the docs are not printed out correctly .
When I implement a For-NExt-Loop before processing the next doc , sometimes all docs are done well... but only sometimes.

I īm glad to hear about any solution for this problem. I donīt prefer a solution in VB , if you know any ActiveX component that can print either HTML as XML , please tell me.

Waiting for your answers ;-))

C...

Three Objects For HTML Via VB 6 (Inet, WebBrowser && HTML) GET META && InnerText
Dear Fellows,

I have few issues in the HTML.

WebBrowser (control):
I am using the WebBrowser component to receive the HTML of web pages, but:
The InnerHTML returning INSIDE the <BODY> (the body tag not includes).
The OuterHTML returning from the <BODY>.


Inet (control):
Or else I am using the Inet component to retrieve the HTML and it dose get it all (with the meta).
I have browse the Inet object to get the InnerText, I haven’t found.
 
I NEED TO GET THE META OBJECT.
I NEED TO GET THE InnerText.

I don’t want to mix with the two objects in order to receive both (Meta & InnerText)

I have started to develop a function that will CONVERT the HTML to TEXT.
I am sure that it dose exist out there.
I AM LOOKING FOR THIS OBJECT (that can be one help)
Note: the conversion of the html should get the html with the tags and the “&”marks (&amp; = “&” or &gt; = “>” etc…) [I don’t know the official naming for them].

Some web pages have redirect when you type one address in the address bar and you get the second one as a result, I need the object to get it too.

Main Question:
1.    how do I get (which object) all the HTML, within it the Title & META and the InnerText of a web page.
I need that object to get me the redirect of URL.


Best regards & thank your 4 using VbCity,
Isaac

Go Through All Objects On The Form
I have many forms. Made trough code and all named "teksti". If I have to resize these all (when form is resized) how to do this?

WebBrowser In Form, Open Popups In New Form
I have a form with the "WebBrowser" in it. When a person clicks a link or a popup appears, instead of opening in an IE window, I want it to launch another copy of my form with the WebBrowser in it and load it there. Anyone know how to do that?

Accessing A Unique MDI Child Form When There Are Multiple Instances Of The Same Form ???
In the application multiple MDI child forms are created as needed. An example is as follows:

Code:Private Sub LoadNewDoc()
    Static lDocumentCount As Long
    Dim frmD As frmDocument
    lDocumentCount = lDocumentCount + 1
    Set frmD = New frmDocument
    frmD.Caption = "Document " & lDocumentCount
    frmD.Show
End Sub

Say that frmDocument contains some subs that I want to call from a different location and multiple instances of this frmDocument are currently in existance. I would like to execute a sub from one of these already existing forms.

I don't know how these forms are uniquely identified to address one of them. I know that the hwnd is unique when they are created but I don't know how to use that for what I want to do. I am imagining an API thing using the hwnd value? I don't want to search all the forms' captions to find the one I want - too slow for what is required - just want to directly access a particular instance of the forms subroutines

Can anyone help?

regards

Resize Form Objects
Hey all,

I have a program that im currently creating on my winXP 1024x768 Res, VB6 computer but today when i went to edit this at college on an NT 800x600, VB6 computer a form exceeded the monitor barriers.

The form has lots of textboxes and an imagebox, This opens up in maximised mode using:


Private Sub Form_Load()
frmWrecks.WindowState = 2
End Sub


Is there a method that can make my maximised form open up with all the textboxes and other objects resized with the form?

thanks for any help on this.

Max Number Of Objects On One Form
I have a program that I an creating that uses a lot of objects (text boxes, picture boxes, buttons, etc.). I have gotten to a point where it says that I have reached the maximum amount of objects allowed on the form. I believe that it is 256 or so. I don't think that there is, but is there a way around this? Is there a way to add more objects to this one form?

Any insight would be helpful.

Copyright Đ 2005-08 www.BigResource.com, All rights reserved