Word adds a VBA project digital certificate signature to a macro

Source: Internet
Author: User

You can use Word macro commands to increase your productivity when you edit a document using Word. By default, the security setting for Word macros is high, and macros are automatically disabled when you run the Word Macro command. If you set the Word macro security to Medium, the Word Macro Security warning dialog box pops up every time you run the Word macro. If you set your Word macro security to low to suppress a security warning, you can increase the risk of malicious code or virus damage. To do this, users can add a digital certificate signature for a VBA project to a Word macro, not only to suppress Word macro security warnings, but also to not reduce the security of Word documents. Taking Word2003 as an example, the concrete implementation method is described as follows.

1. Set the security level for Word macros to "medium"

You first need to set the security of the Word macro to "medium" to see the clearer setting results. After you have signed the digital certificate for the VBA project for the Word macro, set the security to high, as described in the following steps:

Step 1th, run Word2003, and open the Word2003 window. In the menu bar, click tools → macros → Visual Basic Editor menu commands, as shown in Figure 2008061101.

Figure 2008061101 Click the Visual Basic Editor menu command

Step 2nd, open the Visual Basic Editor window, and click the Insert → module menu command in the menu bar, as shown in Figure 2008061102.

Figure 2008061102 Clicking the Module menu command

Step 3rd, open the Module window and enter three lines of code in the window:

Sub Macrodm ()

Msbox "My Macro"

End Sub

and click the "file" → "close and return to Microsoft Word" menu command on the menu bar. In the Word window, click tools → macros → security menu commands to open the Security dialog box. Select the Medium Radio box and click OK, as shown in Figure 2008061104.

Figure 2008061104 The Security dialog box

Step 4th, save and close the current Word file, and then open the Word file again. The Security Warning dialog box is automatically opened to prompt the user whether to run the Word macro, as shown in Figure 2008061105.

Figure 2008061105 Security Warning dialog box

2. Install the digital certificate for the VBA project

The digital certificate that installs the VBA project requires the Office installation CD or installation source files, as described in the following installation steps:

Step 1th, place the Office 2003 installation CD in the CD drive, and then open the Control Panel window and double-click the Add/Remove Programs icon in the Control Panel window. In the open Add or Remove Programs window, select the Microsoft Office Professional Edition 2003 option and click the Change button, as shown in Figure 2008061106.

Figure 2008061106 The Add or Remove Programs window

Step 2nd, open the Microsoft Office 2003 Installation Wizard, select the Add or Remove Features radio box in the Maintenance Mode Options dialog box, and click the Next button, as shown in Figure 2008061107.

Figure 2008061107 Selecting the Add or Remove Features radio box

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.