By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,991 Members | 1,887 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,991 IT Pros & Developers. It's quick & easy.

Encapsulation

P: n/a
I have a piece of code I want to break off into smaller parts, put it
in a module and call the parts as needed. Simple? I don't know.

---------------------------------
Public Function AutomateIE1(IE As WebBrowser, strLink As String) As
String
IE.Navigate strLink

Do Until IE.ReadyState = READYSTATE_COMPLETE
Loop

Do
On Error Resume Next
Set htm = IE.Document
If Not htm Is Nothing Then Exit Do
Loop
Do
On Error Resume Next
Set frms = htm.Forms(0)
If Not frms Is Nothing Then Exit Do
Loop

End Function
----------------------------------

and the calling button processes the 'frms' further. How do I declare
the htm.forms type so I can pass it back. I know it's not a string.
Christian

May 11 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 11 May 2007 14:34:55 -0700, ch************@yahoo.com wrote:

I'm not sure what you are trying to achieve, but you should put:
Option Explicit
at the top of each form. Tools>Options has an option to turn that on
permanently.
The type can be retrieved using the Object Browser (F2).

-Tom.

>I have a piece of code I want to break off into smaller parts, put it
in a module and call the parts as needed. Simple? I don't know.

---------------------------------
Public Function AutomateIE1(IE As WebBrowser, strLink As String) As
String
IE.Navigate strLink

Do Until IE.ReadyState = READYSTATE_COMPLETE
Loop

Do
On Error Resume Next
Set htm = IE.Document
If Not htm Is Nothing Then Exit Do
Loop
Do
On Error Resume Next
Set frms = htm.Forms(0)
If Not frms Is Nothing Then Exit Do
Loop

End Function
----------------------------------

and the calling button processes the 'frms' further. How do I declare
the htm.forms type so I can pass it back. I know it's not a string.
Christian
May 12 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.