View Single Post
  #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 :-)