Re: PS: auto-format all form fields
- From: Jay Freedman <jay.freedman@xxxxxxxxxxx>
- Date: Sun, 10 Apr 2005 23:27:02 -0400
Hi Mike,
Since the documents already exist, you should use the Edit > Replace
dialog to apply the style to the fields. If the fields are not the
only text in the paragraphs that contain them, the style should be a
character style rather than a paragraph style.
Open one document and unprotect it. Press Alt+F9 to display field
codes. Open the Edit > Replace dialog and click the More button.
In the Find What box, enter
^d FORMTEXT
In the Replace With box, enter
^&
which is the code for "the text that was found". Now click the Format
button and select Style; in the next dialog, select your Form Field
style and click OK.
Back in the Replace dialog, click the Replace All button. Close the
dialog, press Alt+F9 again to collapse the fields, protect the
document, and save. Repeat for the other documents.
If you need to do this with a macro that will process all the
documents at one go, see
http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm.
For future documents, you can automate the insert-and-format procedure
by inserting this macro in your template and replacing the text field
button on the Forms toolbar with a button that runs the macro.
Public Sub InsertTextFormField()
Dim oRg As Range
On Error Resume Next
Set oRg = Selection.Range
ActiveDocument.FormFields.Add Range:=oRg, _
Type:=wdFieldFormTextInput
oRg.MoveEnd unit:=wdWord, Count:=1
oRg.Style = ActiveDocument.Styles("Form Field")
Set oRg = Nothing
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
On Sun, 10 Apr 2005 19:29:01 -0700, "mikey"
<mikey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>PS - I have a style already created, called "Form Field." I just want to know
>how to get form fields to use that by default so I don't have to apply the
>formatting manually to each field in all the documents.
>
>Thanks,
>
>mike
>
>"mikey" wrote:
>
>> I have twenty or so documents where I want all the form field font styles to
>> be the same. What can I do so that, when I create a form field, its font is
>> automatically formatted with my desired style?
.
- References:
- auto-format all form fields
- From: mikey
- PS: auto-format all form fields
- From: mikey
- auto-format all form fields
- Prev by Date: How do I open a Publisher document in Word?
- Next by Date: How do I create 'one-click' tickboxes
- Previous by thread: PS: auto-format all form fields
- Next by thread: How do I open a Publisher document in Word?
- Index(es):