Introduction to creating Macros in Word

Source: Internet
Author: User

The macro is actually in our Word or Excel, often encounter a word, perhaps a lot of friends, do not understand it, but its usefulness is really very powerful. Next, interested users can learn how to create a macro in Word with a small weave.

Word

You can use the macro recorder to record a series of actions to create Macros macro: An action or a set of actions that you can perform to automate tasks. You can record macros in the Visual Basic for Applications programming language. Or in the Visual Basic Editor Visual Basic Editor: An environment for writing new Visual basic for Applications code and procedures, and editing existing code and procedures. The Visual Basic Editor includes a complete set of debugging tools to find syntax, run-time, and logical problems in your code. , enter Visual Basic for Applications (Visual Basic for Applications (VBA): Microsoft Visual Basic's Macro language version, which is used to write Microsoft Win based Dows applications that are built into multiple Microsoft programs. ) code to create a macro.

You can also use two methods at the same time. You can record steps and then add code to refine its functionality.

Recording steps

1, on the Tools menu, point to Macros, and then click Record New Macros.

2, in the Macro name box, type the name of the macro.

3. In the Save Macros in box, click the template Template: refers to one or more files that contain structures and tools that form elements such as the style and page layout of a completed file. For example, Word templates can generate individual documents, and FrontPage templates can form an entire Web site. ) or document.

4, in the Description box, type a description of the macro.

5, if you do not want to assign macros to Toolbars toolbar: A column that contains buttons and options that you can use to execute commands. To display the toolbar, press Alt and press SHIFT+F10. , menus menu: A list of commands that appear when you click a menu name on a menu bar or another toolbar. or shortcut key shortcut: A function key or a key combination, such as F5 or CTRL + A, that you can use to execute a menu command. An access key is another key combination, such as alt+f, that you can move the focus to a menu, command, or control. , click OK to start recording the macro.

To assign a macro to a toolbar or menu, click Toolbars, and then click the Command tab. In the Command box, click the macro you are recording, and then drag it to the toolbar or menu you want to specify. Click Close to start recording the macro.

To assign a shortcut key to a macro, click Keyboard, click the macro you are recording in the Commands box, type the shortcut you want in the Press new shortcut key box, and then click Specify. Click Close to start recording the macro.

6. Perform the actions to be included in the macro.

When you record a macro, you can use the mouse to click Commands and options, but you cannot select text. You must use the keyboard to record these operations. For example, you can use F8 to select text, and press end to move the cursor to the ends of the line.

7. To stop recording macros, click Stop Recording.

By using the Visual Basic for applications.

1, on the Tools menu, point to Macros, and then click Macros.

2. In the Macros in list, click the template 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. ) or document.

3, in the Macro name box, type the name of the macro.

4, click Create to open the Visual Basic editor.

Note: If you specify the same name as the existing Microsoft Word built-in command for a new macro, the new macro action replaces the existing operation. To see a list of built-in macros in Word, point to Macros on the Tools menu, and then click Macros. In the macro location list, click Word commands.

Macros in Word, only professional staff commonly used, but the general editor is not interested in this, because it is relatively abstruse, a lot of friends, even do not understand what to do with it, so interested users, their own good study ah.

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.