This article explains how you can digitally sign a file or a macro project by using a certificate . If you don't already have a digital certificate, you must obtain one. To test macro projects on your own computer, you can create your own self-signing certificate by using the Selfcert.exe tool.In this article

Obtain a digital certificate for signing

You can obtain a digital certificate from a commercial certificate authority (CA) or from your internal security administrator or Information Technology (IT) professional.

To learn more about certificate authorities that offer services for Microsoft products, see the list of .

Create your own digital certificate for self-signing

Because a digital certificate that you create isn't issued by a formal certificate authority, macro projects that are signed by using such a certificate are referred to as self-signed projects. Microsoft Office trusts a self-signed certificate only on a computer that has that certificate in your Personal Certificates store.

Create a self-signing certificate

  1. Do one of the following:
    • In Microsoft Windows Vista, click the Start button, point to All Programs, click Microsoft Office, click Microsoft Office Tools, and then click Digital Certificate for VBA Projects. In the Your certificate's name box, type a descriptive name for the certificate.
    • In Microsoft Windows XP, click the Start button, point to All Programs, point to Microsoft Office, point to Microsoft Office Tools, and then click Digital Certificate for VBA Projects. In the Your certificate's name box, type a descriptive name for the certificate.
  2. When the certificate confirmation message appears, click OK.

To view the certificate in the Personal Certificates 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 that you want to sign.
  2. Do the following in these Microsoft Office system programs:

    Word, Excel, or PowerPoint

    • On the Developer tab, in the Code group, click Visual Basic.

      If the Developer tab is not available, click the Microsoft Office Button button image, and then click Program Name Options, where Program Name is the name of the program you are in, for example, Word Options. Click Popular, and then select the Show Developer tab in the Ribbon check box.

    Visio, Outlook, or Publisher

    • On the Tools menu, point to Macro, and then click Visual Basic Editor.
  3. In the Visual Basic Project Explorer, select the project that you want to sign.
  4. On the Tools menu, click Digital Signature.
  5. Do one of the following:
    • If you haven't previously selected a digital certificate or want to use another one, click Choose, select the certificate, and then click OK twice.
    • To use the current certificate, click OK.

Notes: