Password Protection on Office Documents
The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.
Microsoft Office version
For more information, see Features Available by Application and Project Type.
It is possible to set a password on your Microsoft Office Word documents and Microsoft Office Excel workbooks so that they cannot be opened by someone who does not know the password. This option is called Password on Open.
You can create Visual Studio Tools for Office projects using existing documents and workbooks that have Password on Open enabled. The behavior in Visual Studio is different for Word and Excel documents that have Password on Open enabled.
For information about enabling Password on Open, see Help in Word or Excel.
Behavior of Excel and Word
Every time you open an Excel workbook in Visual Studio that has Password on Open enabled, Excel prompts you for the password. When you build your solution you will be prompted for the password again, because the document is opened during build.
The first time you open a Word document in Visual Studio that has Password on Open enabled, Word prompts you for the password. After you successfully enter the password, Password on Open is removed from the document and opening the document will no longer require a password. If you want the document in your solution to require a password before it can be opened, you must enable Password on Open after your final build and before you deploy the solution.