WordBasic Error with Dialog Box Created in Macro Dialog EditorLast reviewed: July 30, 1997Article ID: Q88423 |
The information in this article applies to:
SUMMARYWhen you use the Dialog Editor to create an option button, if you type text in the Text$ box and select the Auto Quote check box, a WordBasic error may appear when you run the resulting macro in Microsoft Word for Windows. The error message occurs if you type quotation marks in the Text$ field of the Button Info dialog box in Dialog Editor. No error message occurs if you do not type quotation marks in the Text$ field. The error message occurs because the Dialog Editor does not translate literal quotation marks to "Chr$(34)" in the Text$ box.
MORE INFORMATIONThe Dialog Editor is used to create custom dialog boxes for use with Word for Windows WordBasic macros. The Auto Quote option automatically encloses button label text in quotation marks so that you don't have to type the quotation marks yourself. In effect, the Auto Quote option forces the text you type to be a string variable, rather than a literal.
WorkaroundIf you want quotation marks to appear around text in a macro, you must use the Chr$(34) statement instead of literal quotation marks. When the Auto Quote check box is selected, do not type any quotation marks in the Text$ field of the Button Info dialog box. If you want to add quotation marks, add them after you paste the text in the macro-editing window in Word for Windows. For example, to add an option button title such as ""My" Button" while the Auto Quote check box is selected, type "My Button" in the Text$ box (without the quotation marks). When you paste the dialog box in the Word for Windows macro-editing window, the following text appears:
OptionButton 10, 6, 110, 16, "My Button"Modify the line so that it reads as follows:
OptionButton 119, 107, 121, 16, Chr$(34) + "My" + Chr$(34) + " Button" Steps to Reproduce Problem
WordBASIC Err=100 Syntax Error REFERENCES"Microsoft Word for Windows User's Guide," version 2.0, pages 787-788, 790-791 "Using WordBasic," by WexTech Systems and Microsoft, page 163 Kbcategory: kbusage kbmacro KBSubcategory: |
Additional query words: winword2 2.0 2.0a 2.0a-CD winword 6.0c
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |