Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Macro in MS Word to clear text fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tccrep - 14 Mar 2006 15:18 GMT
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,
Charles Kenyon - 14 Mar 2006 16:25 GMT
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,
Signature


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.

> Hi there,
>
[quoted text clipped - 8 lines]
>
> Thanks,
tccrep - 14 Mar 2006 17:52 GMT
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,

>If you are using what Word calls an online form simply protecting and
>unprotecting the form will reset all form fields.
[quoted text clipped - 13 lines]
>>
>> Thanks,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.