Microsoft KB Archive/69336

Application Note: WordBASIC Macro Examples

PSS ID Number: Q69336 Article last modified on 07- 8-1991

1.10 WINDOWS

Summary: “WordBasic Macro Examples” is an application note currently available from Microsoft. This note includes a disk with sample Word for Windows macros written in WordBasic. The application note can be obtained by calling Microsoft Product Support Services at (206) 454-2030. This application note can also be found in the Software/Data Library by searching on the keyword WD0120, the Q number of this article or S12921. WD0120 was archived using the PKware file-compression utility.

More Information: The following is the complete content of the application note “WordBasic Macro Examples.” ====================================================================== WD0120: WORDBASIC MACRO EXAMPLES ====================================================================== Revision Date: 6/91 The enclosed disk contains two files that each offer several useful macros: MACROS.DOC (for Word for Windows) and MACROSPM.DOC (for Word for OS/2). These macros are described later in this application note. Note: The information in this application note applies to Word for Windows versions 1.0, 1.1, and 1.10a, and to Word for OS/2 version 1.0. To use these macros, from drive A, open MACROS.DOC in Word for Windows or MACROSPM.DOC in Word for OS/2 by doing the following: 1. Start Word for Windows or Word for OS/2 and from the File menu, choose Open. 2. Insert the enclosed WordBasic Macro Examples disk in drive A. 3. In the Open File Name box, type (without the quotation marks) “a:macros.doc” (or “a:macrospm.doc” for Word for OS/2) and choose the OK button. 4. Locate the macro name and description you want to install. To globally install the macro, double-click the Install button located beneath the macro’s description (or select the Install button and press ALT+SHIFT+F9). 5. When the Install dialog box appears, verify that you want to install the macro by choosing the OK button. Note: After each macro automatically installs, a dialog box will appear asking, “Save global glossary and command changes?” Choose the Yes button. The macros that you install using the instructions above will be added to your Macro menu, allowing you to run each of them by selecting the macro name from the Macro menu from any Word for Windows or Word for OS/2 document. Also, just as with any WordBasic macro, you can run any of these macros by choosing Run from the Macro menu, selecting the appropriate macro name in the Run Macro Name box, and choosing the OK button.

Macro Descriptions
Canon (Two-Bin Printing)'' Lets you choose the bin selection for your print job. The macro displays selections for Automatic Feed, Mixed Bin Feed, Upper Bin, Lower Bin, and Manual Feed. It also allows you to indicate whether letterhead is located in the top bin. ChangeFontStyle Changes font type globally for all styles – that is, without requiring that you enter each style and make the font changes individually. The macro displays a list box with all available fonts and prompts you to select the desired global font. ColumnToggle Toggles the case style of words in specified columns of a selection. The macro prompts you for the starting and ending columns to be toggled. PLPrint'' Prints documents with mixed orientation (portrait and landscape). The macro works only for PostScript, Canon, and Hewlett-Packard LaserJet printers. FileNext Chains documents together for group printing (to print the files, use the FilePrintNext macro). There is no limit to the number of files that can be added. Enter each filename in the dialog box; use the complete pathname (including the extension) if the file is not located in the Word for Windows or Word for OS/2 program directory. Then, press SHIFT+ENTER. For example, type “c:.doc” (without the quotation marks) in the dialog box, and press SHIFT+ENTER. FilePrint Replaces the normal FilePrint macro. This version lets you print ranges of pages (for example, 1-3,5,20) and all odd or all even pages, as well as the normal FilePrint options. FilePrintNext Prints the files that have been chained together using the FileNext macro. The FilePrintNext macro saves the current file and loads each file to be printed in succession, closing each after it is printed and leaving open only the last file printed. PrintMergeHelper Installs the PrintMergeSetup and InsertMergeFields macros, which help you create print merge documents. The two macros allow you to identify merge fields within a data document and, subsequently, to insert the field placeholders into the merge document. Options allow you to merge formats, add a return to the end of a placeholder, and specify whether to leave a blank line if no field data exists for a given record. InsertPicture Lets you choose from different file types to insert a picture, as well as giving you the option to have text wrap around the inserted picture. This macro assumes that you have all of the graphic filters installed. If you do not, refer to page 8 of the “Microsoft Word for Windows Installation Guide” or page 7 of the “Using Word for OS/2” booklet. Orientation Displays a dialog box giving you the option to change the current printer’s orientation from portrait to landscape or landscape to portrait. This macro is designed to work with the Windows PostScript or HP LaserJet (II or III) printers. StrikeThrough Formats the currently selected text with strikethrough characters. This macro will display a message box if there is nothing currently selected. Superscript Formats the currently selected text in true superscript format. This macro works only when you press CTRL+SHIFT+PLUS SIGN (+). Selected text is formatted for character size and position based upon the current point size of the selection. *(Available for Word for Windows only)

Additional reference words: w4wmacro w4wmerge