Reply
 
Thread Tools Display Modes
  #1   Report Post  
linda
 
Posts: n/a
Default 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   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Form Field Ref in Footer Won't Update on Screen StarWine Microsoft Word Help 3 December 6th 04 07:17 PM


All times are GMT +1. The time now is 01:00 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"