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 / October 2006

Tip: Looking for answers? Try searching our database.

Can I create an unprotected formfield in a protected document?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rich - 11 Oct 2006 04:37 GMT
I have created a form in Word that has formfields. Using the Protect Document
panel, I can set the document protection to Read Only and then create
Exceptions for my formfields such that they are freely editable. Why? I want
the formfields to be editable both in terms of content and format.

My question is: how can I do this same thing programatically? I have a macro
that creates a new formfield in the document, but I want to programatically
create an editing restriction exception for the formfield so that it is also
freely editable (content and format).

Thanks,

Rich
Jean-Guy Marcil - 13 Oct 2006 07:56 GMT
Rich was telling us:
Rich nous racontait que :

> I have created a form in Word that has formfields. Using the Protect
> Document panel, I can set the document protection to Read Only and
[quoted text clipped - 6 lines]
> programatically create an editing restriction exception for the
> formfield so that it is also freely editable (content and format).

Set a range to the newly created formfield, and use something like:

   ActiveDocument.Unprotect

   myRange.Editors.Add wdEditorEveryone

   ActiveDocument.Protect Password:="", NoReset:=False, Type:= _
       wdAllowOnlyReading, UseIRM:=False, EnforceStyleLock:=False

But, once the user stars typing in the formfield, it is gone, it becomes
normal text. So, do not use OnExit macros and the like...

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

 
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.