Group:  Microsoft Word ยป microsoft.public.word.docmanagement
Thread: Allow Form Users to Format Text

Geek News

Allow Form Users to Format Text
CJM Type 12/8/2008 9:19:02 PM
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?
Re: Allow Form Users to Format Text
Cindy M. <C.Meister-C[ at ]hispeed.ch> 12/9/2008 7:52:49 AM
Hi =?Utf-8?B?Q0pNIFR5cGU=?=,

[Quoted Text]
> 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 :-)

Re: Allow Form Users to Format Text
Nina 12/9/2008 3:54:03 PM
Hello Cindy,

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

"Cindy M." wrote:

[Quoted Text]
> 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 :-)
>
>
RE: Allow Form Users to Format Text
CJM Type 12/9/2008 6:21:01 PM
Thank you for the input and instruction. You answered my question.

"CJM Type" wrote:

[Quoted Text]
> 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?
Re: Allow Form Users to Format Text
Cindy M. <C.Meister-C[ at ]hispeed.ch> 12/13/2008 10:59:13 AM
Hi Nina,

[Quoted Text]
> 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 :-)

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net