Passing Info to Word Processing Template

Question:
I have a couple of questions about passing information to aword processing template and controlling the saving of the template toanother name. I appreciate any guidance you can provide.

Our application is written using Delphi 1. Our word processingapplication is WordPerfect.

What happens is: A user will bring up information about a client (name, DOB, etc.) on the screen. We want to set up the application so the user can press a button and be taken into the word processing template, and all the relevant information for the client will be imported from the Paradox table into the word processing template. We are having trouble automatically putting the information into the template. The closest we have gotten is having a box come up so the user can enter the info to be placed into each template field.

The second part of our problem (the part we have no idea where to find an answer for) is that after the user has”done his thing” in the template and saves it, we want to save thefilename and location back to our Paradox table so the system will keeptrack of where the reports exist. We are not concerned what the name isor where the file resides, as long as we can track it.

The only thing Icould think of doing is to copy the template to another file name thatthe application would assign, allow the user to update the new fileand save it, but not allow the user to rename thefile. The application runs on a Novell network. I would appreciate anythoughts you might have.

Answer:
As far as the first problem is concerned, my feeling is that you’ll probablyhave to approach this with OLE. I haven’t worked with WordPerfect in thisrespect, but you should be able to get a set of commands that will place theinformation in the proper places. Other than that, you could copythe field values from your Delphi program into a string, like so:

FieldVal1;FieldVal2;FieldVal3;FieldVal4
Then copy the string to the clipboard. You can execute WordPerfect withShellExecute. Check the WordPerfect documentation for command line arguments(loading files, etc.). Anyway, from your template, execute a macro thatwill copy the clipboard contents to a local variable. Then, parse thestring and get the field values to insert into your WP fields.

As far as the second problem is concerned, again you’ll use the clipboard.However, this time, copy the file name of the file you saved to theclipbboard, then close WP. Once it’s closed, you can grab the value inDelphi and put it in the appropriate field in your database.

Granted, this is pretty conceptual, but it should get you pointed in theright direction.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS