Hi there,

I'm trying to create a macro that will clear text fields within a word
document, and i'm having no such luck.

I've created an identical version in excel which works well, but need one for
word too.

Can anyone help?

Thanks,

Re: Macro in MS Word to clear text fields by Charles

Charles
Tue Mar 14 09:25:39 CST 2006

If you are using what Word calls an online form simply protecting and
unprotecting the form will reset all form fields.
ActiveDocument.unprotect
ActiveDocument.Protect Type:=wdAllowOnlyFormFields

For more about online forms, follow the links at
http://addbalance.com/word/wordwebresources.htm#Forms or
http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm especially Dian
Chapman's series of articles. You may also want to look at
http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.htm.

Hope this helps,
--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
"tccrep" <u19672@uwe> wrote in message news:5d3ec6901aa1b@uwe...
> Hi there,
>
> I'm trying to create a macro that will clear text fields within a word
> document, and i'm having no such luck.
>
> I've created an identical version in excel which works well, but need one
> for
> word too.
>
> Can anyone help?
>
> Thanks,



Re: Macro in MS Word to clear text fields by tccrep

tccrep
Tue Mar 14 10:52:55 CST 2006

Thanks for the info, but I think I forgot to mention one important part.

I want to include a command button that when clicked will clear the various
fields.

Can this be done?

Thanks,

Charles Kenyon wrote:
>If you are using what Word calls an online form simply protecting and
>unprotecting the form will reset all form fields.
>ActiveDocument.unprotect
>ActiveDocument.Protect Type:=wdAllowOnlyFormFields
>
>For more about online forms, follow the links at
>http://addbalance.com/word/wordwebresources.htm#Forms or
>http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm especially Dian
>Chapman's series of articles. You may also want to look at
>http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.htm.
>
>Hope this helps,
>> Hi there,
>>
>[quoted text clipped - 8 lines]
>>
>> Thanks,