Thanks for the help and lucid explanation Scott.
Reading your 2nd referenced article, i see where you coded the ability to
use either
infozip or jar to unzip or zip the docx file(s).
afaik if i use jar i shouldn't have to install anything as it's provided
with java(?).
I'm trying to flesh this concept out to see if i can use it for a project
here.
Currently would like to be able to / understand the zip/unzip qshell
pieces more.
I'm struggling with the first line below, if anyone could provide a brief
explanation it would
be appreciated?? (someone with more qshell experience than me)
Code is from Scott's second article link below.
putenv('UNZIPCMD=' + UNZIPCMD);
cmd = 'QSH CMD(''export PATH=$PATH:/usr/local/bin +
&& mkdir "' + tmpdir + '" +
&& cd "' + tmpdir + '" +
&& $UNZIPCMD "' + Template + '" +
&& setccsid 1208 word/document.xml'')';
QCMDEXC(cmd: %len(cmd));
Thanks for any help,
John
<snip>
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!
</snip>
<br />
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful.
As an Amazon Associate we earn from qualifying purchases.