× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



David Foxwell wrote:
Hi everyone,

We have an application that manages the courrier that is sent to our clients.
The text of each courrier is typed in a green screen and saved in a file for
later edition.
Now the boss has discovered the command STRPCO and that instead of showing a
green screen for typing text, we can open a Word document.

Is there any way that, when Word opens, the necessary client information (
name, address, etc ) can be first written to the document from the RPG
application?

TIA

David,

We recently finished some work similar to what it appears you are asking here. Basically, we wanted to merge (a type of form merge) DB2/400 data with Word or PDF. The idea is to allow users to layout a end customer forms with the ease of use of WORD but then merge runtime AS400 data into the WORD document based on the row or data they selected. Here is a sample of all 3 approaches plus PDF:

http://www.planetjavainc.com/wow64Reports/runApp?id=63&_pj_lib=PJUSERREPORTS

There are 3 major approaches you could use: ( I would recommend #1 or #2)

1. HTML - Use WORD to create a nice "form" document and place into the document "variable replacement fields". Save the document as HTML on the IFS or network drive. When needed, RPG reads the document file off disk and replaces all the variable fields with values read from the database. Once merged, you could rewrite the merged file to the IFS and then start word on it or perhaps add more value by having a CGI or web application that the end users could bring up to view the output directly.

Is the document being emailed or sent to the courrier?


NOTE: Since WORD saved the HTML it still knows how to edit it.

2. XML - Same as #1 above but save the file as XML which is a format called WORDml or WML. This is a text format which can be read as strings and updated as noted above. It may require the clients to have Windows 2003 but we have noted W2K clients opening it fine. This document opens as an WORD application plug in to IE.

3. Direct Word APIs - Requires windows so you would have to have client side code and communicate RPG to sockets. On the client the socket would have to call MS DLLs to tell word to update bookmarks. As Aaron mentioned, this is not good because of MS server apis so I wouldn't recommend this approach.

4... It is also possible to use VBScript from an i5 web application to launch and type WORD documents, OUTLOOK tasks, etc.

HTH,

Thanks, Paul Holm


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.