Obtain a digital certificate for signing
From a commercial certification authority (CA), a certification authority (CA): A business organization that issues digital certificates, tracks people who are issued certificates, signs certificates to verify their validity, and tracks certificates that have been revoked or expired. Or obtain a digital certificate from an internal security administrator or information technology (IT) professional.
To learn more about the certification authority that provides services for Microsoft products, see the list of Microsoft root Certificate Program members (English).
Create your own digital certificate for self-signed
Because you create a digital certificate that is not issued by a formal certification authority, a macro project that is signed with such a certificate is called a self-signed project. Microsoft Office trusts the certificate only on computers that have a self-signed certificate in the personal certificate store.
Create a self-signed certificate
What kind of operating system are you using?
Windows Vista
Windows XP
Windows Vista
1. Click the Start button, point to All Programs, and then click Microsoft Office, Microsoft Office Tools, and digital certificates for VBA projects. In the name of your certificate box, type a descriptive name for the certificate.
2. When the certificate confirmation message appears, click OK.
To view the certificates in the personal certificate store, do the following:
1. Open Windows Internet Explorer.
2. On the Tools menu, click Internet Options, and then click the Content tab.
3. Click Certificates, and then click the Personal tab.
Windows XP
1. Click the Start button, point to All Programs, Microsoft Office, and Microsoft Office Tools, and then click Digital Certificates for VBA projects. In the name of your certificate box, type a descriptive name for the certificate.
2. When the certificate confirmation message appears, click OK.
To view the certificates in your personal certificate store, do the following:
1. Open Windows Internet Explorer.
2. On the Tools menu, click Internet Options, and then click the Content tab.
3. Click Certificates, and then click the Personal tab.
Digitally sign a macro project
1. Open the file that contains the macro project you want to sign.
On the Development Tools tab, in the code group, click Visual Basic.
If the Development Tools tab is not available, click Office buttons, and then click Word Options. Then click Common, and select the Show Developer tab in the Ribbon check box.
Note the ribbon is part of the Microsoft Office Fluent user interface.
2. In Visual Basic Project Explorer, select the project you want to sign.
3. On the Tools menu, click Digital Signature.
4. Do one of the following:
If you have not previously selected a digital certificate or want to use another digital certificate, click Select to select the certificate, and then click OK two times.
To use the current certificate, click OK.
Comments
Macros can be signed only after the solution has been tested and can be published, because the digital signature of a signed macro project is deleted as long as any changes have occurred in the code. However, if you have a valid digital certificate that was previously used to sign a project on your computer, it is automatically re-signed when you save the macro project.
To prevent users of the solution from accidentally changing the macro project and invalidating the signature, you can lock the macro project before signing it. Your digital signature only indicates that the item has not been tampered with after you signed it, but it is not guaranteed to be the project you are writing. Therefore, locking a macro project does not prevent other users from replacing your digital signature with another signature. Enterprise administrators can re-sign templates Template: Refers to one or more files that contain structures and tools that form elements such as the style and page layout of finished files. For example, Word templates can generate individual documents, and FrontPage templates can form an entire Web site. and add-ins: Supplemental programs that provide custom commands or custom functionality for Microsoft Office. For precise control over the users who can run on their computers.
If you create an add-in that adds code to a macro project, the code should determine whether the project has been digitally signed and inform the user of the consequences of changing the signed item before the user continues the operation.
When you digitally sign a macro, you must obtain a timestamp so that other users can verify your signature even after the certificate used for signing has expired. If a timestamp is not used when the macro is signed, the signature is valid only for the validity of the certificate.