Solved

Using Delphi3 with Wordperfect

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why does formely good SQL code in Delphi 2009 not work under Windows 10? 5 97
indy Tmemory stream non latin charcter issue 2 110
Intraweb download file link ? 1 134
Delphi 2 60
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 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