protect document in macro

M

Micayla

i have created a macro which inserts a table from the
same document. my conundrum is that the 2nd table is not
locked like it should be. i have inserted a section break
to enable the user to insert the 2nd table, and all
sections are locked but the locking does not seem to
effect the 2nd table even though it is within the 3rd
section which is locked. it is locked in the template but
not the new documents based on it. What am i doing wrong?
thanks
 
D

Doug Robbins - Word MVP

Hi Micayla,

It would be must easier to help you if you pasted the code that you are
using into your message.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
M

Micayla

I have not actually written the code - i recorded the
macro in word. here is the code from vba editor
Sub table()
'
' copy.table Macro
' Macro recorded 20/11/2003 by Micayla Bergen
'
Selection.TypeParagraph
Selection.TypeParagraph
Selection.InsertBreak Type:=wdPageBreak
Selection.MoveDown Unit:=wdLine, Count:=2
Selection.PasteAndFormat (wdPasteDefault)
End Sub

Thanks
 
D

Doug Robbins - Word MVP

Hi Micayla,

For this macro to work, you would have first had to remove the protection
from the document. To reapply it, use

ActiveDocument.Protect wdAllowOnlyFormFields, NoReset.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
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