Microsoft KB Archive/94711

= Microsoft Knowledge Base =

Sample Macros Included with 'Using WordBasic' Book
Last reviewed: July 30, 1997

Article ID: Q94711

The information in this article applies to:


 * Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, and 2.0c
 * Microsoft Windows operating system, versions 3.0 and 3.1

SUMMARY
&quot;Using WordBasic&quot; by WexTech Systems and Microsoft includes a disk labeled &quot;Sample Macros for Using WordBasic&quot;. The disk contains a single template, USINGWB.DOT, with sample WordBasic macros. The macros stored in the template are referred to in the following &quot;Using WordBasic&quot; chapters:

Chapter 2, &quot;The WordBasic Language&quot; Chapter 3, &quot;More WordBasic Concepts&quot; Chapter 5, &quot;Dynamic Data Exchange&quot; Chapter 6, &quot;Macro Applications&quot; &quot;Using WordBasic&quot; (part number 059-050-574) by WexTech Systems and Microsoft is available by calling Microsoft Sales Information Center at (800) 426-9400. Your first copy is free; additional copies cost $15.0 each, plus tax and shipping charges.

MORE INFORMATION
The macros are described in Appendix A of &quot;Using WordBasic&quot; and also in the USINGWB.DOT template.

InitialCaps
This macro converts all text that is formatted with a style you specify to text beginning with initial capital letters. The macro prompts you for the name of the style and proposes Heading 1 as the default.

FooterSetup2
This macro displays a dialog box for inserting the title, author's name, date, and page number into a header or footer.

ComplexDialogBox
This macro demonstrates the range of items that you can display in a custom dialog box created with a WordBasic macro.

MACROS IN CHAPTER 3, &quot;MORE WORDBASIC CONCEPTS&quot;
The names of the &quot;auto&quot; macros in this template begin with &quot;UWB&quot; to prevent them from running automatically. To make these macros run automatically, rename each one by removing the letters &quot;UWB&quot;.

UWBAutoOpen (template macro)
This macro inserts the date and time at the end of a document based on the template that contains this macro.

UWBAutoNew (template macro)
This macro inserts the AUTHOR field into the footer of every new document based on the template that contains this macro.

UWBAutoClose (template macro)
When you close a document based on the template that contains this macro, the macro displays the Summary Info dialog box (File menu), gets the user's changes, and updates the information using the FileSummaryInfo statement.

UWBAutoExit (global macro)
This macro restores the default settings in the View category of the Options dialog box (Tools menu) when you quit Word.

DDEExcel
This macro starts Microsoft Excel, requests lists of the topics available for initiating a DDE interchange, and sends to and receives data from a Microsoft Excel worksheet.

ReformatASCII
This macro reformats files that contain hard carriage returns at the end of each line into Word paragraphs, removing tabs or repeated spaces at the beginning of paragraphs.

MacroManager
This macro copies one or more macros from one template to another. It displays a dialog box for you to select a source and destination template and the name of a macro to copy.