form field results

F

fred kruger

Hi helen

as long as you know the name of the formfield setting the
text to "" is easy just use the following
ActiveDocument.FormFields("div").Result = ""
where div is the name of the formfield.
to check each one you would have to put a loop in so that
each formfield is checked for entry etc.

This procedure you could enter once in a globally loaded
template but you will still have to open each of your
1000 templates and reference them to the globall template
and then call the formfield procedure.

Hope this is some use to you.

Fred
 
L

Lars-Eric Gisslén

Helen,

We are using our own generic way of dealing with thouse kind of problems,
like controlling the Tab order, clearing fields, copying fields values to
other fields that should have the same value and so on.

We give the first field a name like Customer. The fields that relates to
that field we give the same name but with a sequential number like
Customer1, Customer2 and so on. We specify an OnExit macro for the Customer
field that clears, or what ever, related fields. The macro may look like
this:

Sub ClearRelatedFormFields()
Dim sBM As String
Dim sNextFF As String
Dim nCount As Long
Dim bCont As Boolean

sBM = Selection.Bookmarks(Selection.Bookmarks.Count).Name

If sBM = "" Then Exit Sub

nCount = 1
bCont = True

With ActiveDocument
If Trim(.FormFields((sBM)).Result) = "" Then
While bCont
sNextFF = sBM & Format(nCount)
bCont = .Bookmarks.Exists((sNextFF))
If bCont Then
.FormFields((sNextFF)).Result = ""
nCount = nCount + 1
End If
Wend
End If
End With

End Sub

With the technique above you can create generic macros that you can reuse
over and over.

Regards,
Lars-Eric
 

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