[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Using Delphi3 with Wordperfect

Posted on 1998-05-27
5
Medium Priority
?
238 Views
Last Modified: 2010-04-06
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.
0
Comment
Question by:jfreisen
  • 3
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
ahalya earned 400 total points
ID: 1348145
i do this with WP7 & guess this shoud work with 8 as well.


Var WP : Variant;

begin
WP := CreateOleObject( 'WordPerfect.PerfectScript');
WP.FileOpen (YourFileName) ;
WP.BookmarkFind ('Introduction') ;
WP.KeyType ('typing some text at bookmark introduction') ;
WP.BookmarkFind ('theory') ;
WP.KeyType ('some more texty into the second bookmark') ;
WP.FileSave (NewFileName,  4 ) ;
end;

0
 

Author Comment

by:jfreisen
ID: 1348146
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.
0
 
LVL 7

Expert Comment

by:ahalya
ID: 1348147
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;

0
 

Author Comment

by:jfreisen
ID: 1348148
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?
0
 
LVL 7

Expert Comment

by:ahalya
ID: 1348149
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)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question