Link to home
Start Free TrialLog in
Avatar of jfreisen
jfreisen

asked on

Using Delphi3 with Wordperfect

How do I accomplish the following: Start Wordperfect8, open an existing document having bookmarks, insert some text into certain bookmarked fields from my Delphi3 paradox app, saveas another document name and then let the user take control of Wp to finish the document.
ASKER CERTIFIED SOLUTION
Avatar of ahalya
ahalya
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jfreisen
jfreisen

ASKER

That worked great except how can I first check to see if WP is loaded and if it is use that instance else start it up. I get an error on the fileopen line if WP was already loaded.
i'm not sure why. normally if WP is already loaded then the CreateOLE function activates the already loaded instance (at least it does so in my machine).

i check the "Number of Open Documents" function and the "document blank" functions to see whether some other documents are open in WP or it is only my OLE doc. (at the end i do the following)

var i : intreger;
    b : boolean;

WP.FileClose;
i := WP.EnvNumberOpenDocuments;
b := WP.EnvDocBlank ;
if (i =1) and b then  //there is only one blank doc open !
    objWP.ExitWordPerfect;

Thanks, I will give that a try.  Where do I find a list of all the functions I can use in Delphi to control WP?
In Word perfect macro help you can find all the available commands and the variables. (wp variable ?DocBlank becomes EnvDocBlank in delphi).

You can get the complete syntax in WP help. (WP macro programming -since the introduction of PerfectScript- is essentially the same as OLE commands)