In this article, we will give you detailed instructions of how to digitally sign your Word macro project.
By and large, Word disables all macros and pops up notifications whenever we show the intention to run one. This means we have to personally confirm the operation every time we open a Word document containing a macro, which is not convenient. While on the other hand, if we enable all macros, we are put our files and computer at high risk.
Obviously, neither is perfect. Actually, to address this issue, we have a better way that is to digitally sign macros and grant to run them only.
Now follow the guide below to finish the setting.
Alter Macro Security Level
- First and foremost, open Word and click “Developer”. Remember to ensure the “Developer” tab is available.
- Second, click “Macro Security” in “Code” group.
- In the “Trust Center” dialog box, check “Disable all macros except digitally signed macros” box.
- Then click “OK”.
- Next click “Visual Basic” in “Code” group under “Developer” tab.
- Now you shall have opened the VBA editor. Click the Project of this document and click “Insert” on toolbar.
- Then choose “Module” and you shall open the code editing area on the right side.
- Next, you can copy the following codes there as a test macro.
Sub TestMacro() MsgBox ("Test!") End Sub
- Now go to save the document. You will receive a message box, such as below:
Just click “No”.
- And you will back to “Save As” window. First choose a storage location.
- Then choose “Word Macro-Enable Document” as file type.
- Next, click “Save” button.
- Open the document with the test macro again. And click “Macros” under “Developer” tab again.
- Then choose the test macro and click “Run”.
And you will receive a warning message, suggesting the macro is disabled.
Install Digital Certificate for VBA Projects
- Firstly, click “Start” menu in Windows.
- Click “All Programs” next.
- Then find and click “Microsoft Office”.
- Next continue to find and choose “Microsoft Office Tools” file for the version you use.
- And click “Digital Certificate for VBA Projects”.
- Now you will see “Create Digital Certificate” dialog box. Enter your certificate name.
- Click “OK” to save the change.
Now if you can’t find “Digital Certificate for VBA Projects”, you can take the following leads to fix it:
- To begin with, insert Microsoft Office installation disc into your computer.
- Then click “Start” menu.
- And click “Control Panel”.
- Next click “Programs” and “Programs and Features” in order.
- Then on the list box, find and click the right version of Microsoft Office.
- Next right click and choose “Change”.
- In the installation guide, check “Add or Remove Features”.
- Then click “Continue” button.
- Next, under “Installation Options”, click “Office Shared Features” first.
- Then click “Digital Certificate for VBA Projects”.
- On the list-menu, choose “Run from My Computer” and follow the guide to finish the progress.
Digitally Sign Word Macros
- First of all, open the document with macro inside and open VBA editor, too.
- Then click “Tools”.
- And choose “Digital Signature”.
- Now in “Digital Signature” dialog box, click “Choose” button.
- Then in the new box, select a certificate.
- And click “OK”.
- Remember to click “OK” in “Digital Signature”, too.
- Now you can save and close your document.
- Next time you open the document. You may see such a warning message: Macros have been disabled.
Click on the message.
- Now in the backstage view, click “Enable Content” first.
- Then click “Advanced Options”.
- In “Microsoft Office Security Options” dialog box, check “Trust all documents from this publisher”.
- Then click “OK”.
File Corruption Happens Anyway
The fact is that you back up all critical files, run antivirus programs routinely, and avoid bad habits while working with Word as possible as you can, yet you still suffer file loss. This can be a huge blow to your confidence in taking precaution measures. Nevertheless, you have to continue doing all the preventive steps, including getting a fully-fledged corrupt Word repair tool.
Author Introduction:
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including damaged xlsx recovery tool and pdf repair software products. For more information visit www.datanumen.com