Protected Forms/Cannot Update TOC

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can't seem to update the TOC when there are protected forms within a
document. Does anyone know of a workaround for this issue? Thanks.
 
Hi =?Utf-8?B?ZXJpa19ncmVnb3J5?=,
I can't seem to update the TOC when there are protected forms within a
document. Does anyone know of a workaround for this issue?
Unfortunately, this is the case. You'd need to unprotect, update the TOC,
then reprotect. This can be done with a fairly simple macro:

Sub UpdateTOCinForm
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 :-)
 
Thanks Cindy, owe you a beer
One question though, What if I have two TOCs? Only the first is updated but
I can press F9 to update the second
Seeya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top