1. How to find the correct Visual Basic for Applications (VBA) syntax needed in Word and how to convert it into the correct PowerBuilder syntax
With Word 8 / Office 97, Microsoft changed the way applications communicate with Word via OLE. Old WordBasic syntax may not work properly and converting them to VBA equivalents may be required.
1.1 Use the Word Macro Editor
An easy way to determine the VBA functions and their syntax by using the macro editor which is integrated in Word. To obtain the VBA functions turn on the macro recording in Word, perform the tasks you wish the Macro to perform (IE. Highlight some text), and then turn off the recording. With ALT + F11 you are able to open the Macro editor and see the syntax used by Word.
To get a complete description of a function and to see the complete syntax you can use the help file VBAWRD8.HLP which is available through a custom installation of Word (you must specify to install this help file during the installation process, it is not installed by default). Here you will find information regarding the functions you can use in Word and their VBA and WordBasic syntax. Furthermore you will be instructed which functions you can use with Word 8.
1.2 Convert VB Syntax to the PowerBuilder Syntax