Article Purpose: This article provides step-by-step instructions for using your code signing certificate to sign VBA code in Microsoft Office 2007. If this is not the solution you are looking for, please search for your solution in the search bar above.
- From your document, right-click the ribbon bar and select Customize Quick Access Toolbar.
- In Word Options select Popular. Select the Show Developer Tab in the Ribbon option.
- From your document select the Developer tab. Click the Visual Basic button.
- At this point the Visual Basic Editor will open with the project name of the file you are working on. Right-click on Microsoft Word Objects in the left-hand pane and select Insert. Click Module.
- You may now enter your visual basic code in the main panel.
- From here you can sign your code with your Code Signing certificate by choosing Tools and then Digital Signature from the top menu.
- Another window will open and you will see the current signature associated with this module. Office will allow you to choose a certificate to either sign the module or change the certificate which has currently signed the module.
- If you chose to select a different certificate you will be presented a screen to select the certificate you wish to sign your code. Select your certificate. Click OK.
- The module will be signed with the chosen certificate.
- Save your file from inside the Visual Basic Editor.
- In order to test that the VBA in the document has been properly signed, close the document from your office application and then reopen it. If Macros are set to "Disabled with Prompt" you will receive the Security Warning bar. Click Options to continue.
If macros are set to "Disabled Without Prompt", the user will not have the option to run the macros whether they are signed or not. This is a local setting that cannot be overridden and must be change by the end user.
- To always trust Macros from this publisher select Trust Documents From This Publisher.
- Once accepted, the Macros will run transparently.