Solved

Using Delphi3 with Wordperfect

Posted on 1998-05-27
5
229 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 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now