Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
McWilfred McWilfred is offline
external usenet poster
 
Posts: 1
Default highlight all completed form fields

I need to highlight all the fields in a Word form that have been completed.
I'm a vb novice. . .
With assistance from some very helpful postings, I now have a functional
form that accomplishes my objectives. However, I'm sure there's a much better
way. I currently have one macro per field, each activated when exiting the
field.

How can I have a macro check all the fields for content and then highlight
those that are not blank? And, if I do that, I'm assuming that it would still
be best to reference that one macro when exiting each field?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default highlight all completed form fields

Use:

Dim i As Long
With ActiveDocument
.Unprotect
For i = 1 To .FormFields.Count
With .FormFields(i)
If .Type = wdFieldFormTextInput And Trim(.Result) "" Then
.Range.Font.Color = wdColorGreen
End If
End With
Next i
.Protect wdAllowOnlyFormFields, noreset
End With


--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"McWilfred" wrote in message
...
I need to highlight all the fields in a Word form that have been completed.
I'm a vb novice. . .
With assistance from some very helpful postings, I now have a functional
form that accomplishes my objectives. However, I'm sure there's a much
better
way. I currently have one macro per field, each activated when exiting the
field.

How can I have a macro check all the fields for content and then highlight
those that are not blank? And, if I do that, I'm assuming that it would
still
be best to reference that one macro when exiting each field?


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting a form once completed so as others cannot edit Tracy Tait Microsoft Word Help 7 June 10th 07 01:13 AM
Can I build a form that can be completed using a letter merge? auda19 Mailmerge 3 May 10th 07 08:45 AM
How do you add new fields to a completed mail merge document? Cynthia A Mailmerge 1 August 31st 06 02:06 PM
prevent form being completed until check box has been selected lccbft Microsoft Word Help 1 April 11th 06 03:54 PM
Prevent moving on to next field in a form unless it is completed. GMI Microsoft Word Help 1 April 7th 05 09:57 PM


All times are GMT +1. The time now is 04:53 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"