Home |
Search |
Today's Posts |
#1
|
|||
|
|||
macro for unprotecting form, update TOC, then reprotect form??
It is a known issue that TOC page numbers do not update properly in a
protected form. What I am looking for is some sample macro that would unprotect the form, force the TOC page numbers to update, then reprotect the form. I would like this to be as seamless as possible to users of the form. I am not very knowledgeable in creating macros yet, and would appreciate any help!! |
#2
|
|||
|
|||
Hi Linda,
It is a known issue that TOC page numbers do not update properly in a protected form. What I am looking for is some sample macro that would unprotect the form, force the TOC page numbers to update, then reprotect the form. I would like this to be as seamless as possible to users of the form. Try this. I didn't test it, so no guarantees (like, I don't know whether the TOC will finish updating before the protection is reinstated), but give it a try: Sub ShowEditLinks() Dim doc As Word.Document Set doc = ActiveDocument If doc.ProtectionType wdNoProtection Then doc.Unprotect End If doc.TablesOfContents(1).Update doc.Protect wdAllowOnlyFormFields, True End Sub Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) 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 :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text Form Field Ref in Footer Won't Update on Screen | Microsoft Word Help |