Tech Support banner

Status
Not open for further replies.
1 - 3 of 3 Posts

·
Registered
Joined
·
2 Posts
Discussion Starter #1
I need to be able to lock a word master document from VBA. In word from the outline view when I position the cursor inside the master document and click the Lock Document icon this works fine but if I record these actions the macro produced contains the code:
Selection.Range.Subdocuments(1).Locked = Not Selection.Range.Subdocuments( _
1).Locked
If I run this macro I get a message saying the selected member of the collection does not exist.

Anyone know how to lock a master document from VBA?
 

·
Registered
Joined
·
2 Posts
Discussion Starter #3
Hi, Whosdat,

Thanks for your reply but unfortunately I cant find anything useful on your link.

I have found a solution to my particular problem. I have a number of sub-documents only one of which is unlocked. I did not want the user to be able to type anything in the master document itself, hence my original problem. If you go into the print layout view with the sub documents not expanded, it is possible to delete the paragraph marker at the bottom so tha there is no part of the master document that the user can type in.

This solves my current problem but I would still like to know what word does to lock the master. It certainly isn't what the recorded macro says!

Regards

Malcolm
 
1 - 3 of 3 Posts
Status
Not open for further replies.
Top