Inserting Text in Non-protected Section of Protected Doc

E

Edd

I have a macro which inserts text into a non-protected section of a word
document which will not work in Word 2003 although it did in word 2002.

The document has a protected form section at the top of the page to use as a
header and a non protected section at the bottom. Any Ideas.

'Move to Unprotected Section
Selection.GoTo What:=wdGoToSection, Which:=wdGoToFirst, Count:=2, Name:=""

'Get and Insert File Names
Count = 1
Selection.InsertAfter Text:=Count & Chr(9) & DirFiles & " * " & Chr(11) &
Chr(13)
 
D

Doug Robbins - Word MVP

The usual way of doing this is to have the macro unprotect the document,
perform the task that is required and then to re-apply the protection.

It would be better for you to use InsertBefore or InsertAfter the Range of
the Section rather than be moving the selection.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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

Top