The Word add-in is for all word documents. The document-level project is only for a special document. This also been could done in a Word add-in or a Word document-level project. 'ActiveDocument.Protect ' Protect this document again 'ActiveDocument.Unprotect ' Unprotect this document Private WithEvents wdApp As Word.Application Here is a sample code in ThisDocument you could refer to. By pressing Alt + F11, we will see the VBA code for these methods, which show basic syntax and could be reused. Protect and Unprotect method, please see this MSDN page:įor the VBA code about these methods, we could record a macro for Protect, Unprotect and Protect. We could put this code into Close event handler. If you are using Protect method to protect the document, as far as I see, the only way is to unprotect this document and protect all content in this document by Protect method again.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |