× 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.



Just in case it helps - I have found that most of Penton’s formatting screw ups disappear if you use the Evernote browser plug-in and select "Simplified Article”.

Since I don’t trust Penton to keep all this good stuff around I have started capturing ones I consider important in Evernote.


On Dec 9, 2015, at 12:31 PM, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote:

John,

The docx format isn't, precisely, "just XML".

It is actually a ZIP file containing a directory structure. Most of the files that will be in that directory are, indeed, XML files. However, there are other file types sometimes (such as images that are to show up as embedded in the Word document.)

So I would start by creating your template file in Word, then save it to the IFS.

Once there, I'd use a tool like InfoZip's "unzip" command in PASE to unzip the docx file to a temporary directory. (It's also possible to use Java's "jar" utility for this, but I personally like 'unzip' a lot better.) Explore that directory a bit, and hopefully you'll get the feel for what it looks like.

The file named 'document.xml' in the 'word' directory is the main one you'll want to change if all you need is to change the text of the letter.

I did write two articles that explained this and gave examples, here:
http://iprodeveloper.com/print/rpg-programming/how-create-word-document-rpg
http://iprodeveloper.com/rpg-programming/build-word-document-rpg-table

Penton Media who owns that site has totally screwed up a lot of the formatting in the articles, but sometimes clicking the 'print' button at the bottom of the article makes it easier to read.

Good luck!


On 12/9/2015 11:04 AM, JRusling@xxxxxxxxxxx wrote:
I've perused the list, mainly the contents of this thread
http://archive.midrange.com/rpg400-l/201009/msg00170.html
1. Create your word document and save it as the new DOCX format,
which is just XML.
2. Edit the XML in notepad or whatever you like, and add in
the CGIDEV2 tags for what you want.
3. Copy DOCX file to IFS.
4. Use CGIDEV2 to insert the needed data based on tags you inserted.

I would like to create a docx xml template, then use cgidev2 to open
it and generate some form letters. Some of the resulting letters
will be emailed, others printed.

When I open my template docx file (with docx extension) in notepad the
text is unintelligible.

Is this process not doable? Am i missing a step? any ideas appreciated?
I have tried most 'save as' output options from Word.

Thanks,
John
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.