Allow Form Users to Format Text

C

CJM Type

I created a form in Word. Is there a way to allow the user (the person who is
filling in the form with information) to format the text that they input into
the fields; e.g., if they want to make a word bold or italic, can they do so?
 
C

Cindy M.

Hi =?Utf-8?B?Q0pNIFR5cGU=?=,
I created a form in Word. Is there a way to allow the user (the person who is
filling in the form with information) to format the text that they input into
the fields; e.g., if they want to make a word bold or italic, can they do so?
If you're using form fields and forms protection, then this is only possible
using a macro. And if the form fields are within a table, then the macro would
be non-trivial (because the user can't select characters within a form field
embedded in a table cell).

The macro, outside a table, is fairly trivial:

Sub FormBold()
Dim doc as Word.Document

Set doc = ActiveDocument
if doc.ProtectionType <> wdNoProtection Then
doc.Unprotect
End If
Selection.font.Bold = true
doc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
N

Nina

Hello Cindy,

I'm just wondering when do you invoke the macro? When your cursor is within
the form field?
 
C

Cindy M.

Hi Nina,
I'm just wondering when do you invoke the macro? When your cursor is within
the form field?
In the context of the original question, the user makes a selection then clicks
a button (or presses a keyboard shortcut). So, yes, the selection is in the
form field.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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