Microsoft KB Archive/112733

= FILE: Help File for VB OLE Automation w/ Word for Windows =

Article ID: 112733

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Word 6.0a
 * Microsoft Word 6.0c
 * Microsoft Word 6.0 Standard Edition
 * Microsoft Word 95 Standard Edition
 * Microsoft Word 95a
 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q112733



SUMMARY
The contents of POSITION.TXT, a file currently being shipped with the Word Development Kit (WDK), is available as a Help file (POSITION.HLP) for use by Visual Basic version 3.0 programmers who want to use OLE Automation to access WordBasic in the versions of Microsoft Word listed at the top of this article.

POSITION.HLP provides a listing of WordBasic functions and all their required parameters in the proper order, which is not the case in Word version 6.x Help file.

In Microsoft Word 97 and later versions, WordBasic has been replaced with Visual Basic for Applications. For backward compatibility, the Microsoft Word Visual Basic for Applications language contains a WordBasic Object. To ensure the correct WordBasic command argument positioning when using OLE Automation, use the POSITION.HLP file for Word for Windows version 6.x.

NOTE: If your program was written to call WordBasic commands and you are anticipating interacting with the Microsoft Word Visual Basic for Applications language for all future development, it is recommended that you convert your code from WordBasic to the Microsoft Word Visual Basic for Applications commands.

The following file is available for download from the Microsoft Download Center:

Position.exe

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.



MORE INFORMATION
WordBasic statements or functions in Microsoft Word can take named arguments. But Visual Basic version 3.0 does not support named arguments so when a Visual Basic version 3.0 application sends WordBasic commands through OLE Automation, Visual Basic must specify all the parameters to a WordBasic function in the proper order. The same call in WordBasic may only require some of the parameters using named arguments, and those parameters could be provided in any order.

For most WordBasic statements, the positioning of the arguments is documented in the WordBasic Help topics or printed reference entries for those statements. However, the arguments for some statements are not listed in proper order, or the arguments are irrelevant or have no effect. These arguments are not documented in WordBasic Help or in the printed reference.

For example, the InsertIndex statement corresponds to the Index tab in the Index and Tables dialog box. The InsertIndex statement takes a number of arguments that have to do with other tabs in the dialog box, such as the Table of Contents tab. Because these arguments are irrelevant to inserting an index, they are ignored and therefore not documented in WordBasic Help or in the printed reference. But you, as a Visual Basic version 3.0 OLE Automation programmer, need to be aware of these arguments so you can correctly specify arguments by position.

Keywords: kbdownload kbprogramming KB112733

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.