VBA scripting in Word 2003

A

Amber

I created a form using the web tools (I plan to add to company website). I am
having problems validating required user input. On a regular word form, I
validate the fields using ActiveDocument.FormField(FieldName). How would I do
this same thing on a form created with the web tools?
 
D

Doug Robbins - Word MVP

What do you mean by web tools?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
A

Amber

View < Toolbars < Web Tools

I used Check Box, Option (Radio) Button, Drop-Down Box and Textbox

Thanks for your help!
 
A

Amber

I have a better way to ask my question.
How would I check for a required field in Microsoft Visual Basic 2003 for a
web form?
 
D

Doug Robbins - Word MVP

If no one else steps in in the meantime, this will have to wait until Monday
when I get access to a machine that is running a version of Word before 2007

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
T

Tony Jollans

I've never done this so all I can tell you is from observation just now.

Each web control seems to belong directly to the document so you can refer
to it as:

ActiveDocument.control_name

Default names are like HTMLText1, etc., but you call them whatever you like.

Alternatively, they belong to the Fields collection (and either Shapes or
InlineShapes) so you can iterate over them something like this:

For Each fld In ActiveDocument.Fields
If fld.Type = wdFieldHTMLActiveX Then
Set ctl = fld.OLEFormat.Object
' Now you can look at properties of the object
' which will vary according to type
Select Case fld.OLEFormat.ClassType
Case "Forms.HTML:Checkbox.1"
MsgBox "This is a CheckBox called " & ctl.Name
Case "Forms.HTML:Text.1"
MsgBox "This is a TextBox called " & ctl.Name
Case Else
MsgBox "This is something else"
End Select
End If
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top