Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help! Formating for Word on AIX w/9.1D CHUI

Status
Not open for further replies.

Faelcu

MIS
Oct 28, 2002
19
US
Hi, All.
I need some help. I have a program that emails a text file to the user. They now want this file formatted to a Word .DOC file (with specific margins, font sizes, etc.). I have no idea how I can make this happen. Changing the file extension from .TXT to .DOC makes no difference at all.

We're on AIX on Progress 9.1D CHUI. Has anybody got any info that can help me? I'd so very much appreciate it.

TIA
 
THis is a start for ya. I found this from the PEG. I've never done it myself, I've sent stuff to EXCEL before, but not word.

/*****************************************/
/*use this to keep the application handle*/
DEF VAR wordapp AS COM-HANDLE.
/*create the word application*/
CREATE "word.Application" wordapp.
/*display the application*/
wordapp:VISIBLE = TRUE.
/*add new document*/
wordapp:Documents:ADD().
/*write something on the document*/
wordapp:SELECTION:TEXT = "hello World".
/*free the memory*/
RELEASE OBJECT wordapp.

/**************************************/
HTH, Shawnna
 
Shawnna,

Word is a windows app, and can only be invoked from a Windows client. Faelcu is on ChUI AIX.

Mike.
 
I don't want to actually work with Word, just put some formatting into the text file that I output so the users can open the file in Word without having to manually put in all the formatting.

HTH
TIA
 
I suppose you could research Rich Text format and output your document as a .rtf file. I suspect, though, that HTML wuld be simpler -- Word can read .html files as long as you don't try to do anything too complicated.

Mike.
 
I'd vote for HTML, too, but you might not have as much control as you want over the attributes you mentioned (specific margins, font sizes, etc.)

This sounds very much like an idiotic requirement that begs the question, "Why?" Is the reader of the email so delicate that s/he can't bear the sight of monospaced text? Is your pointy-haired boss so clueless about the technology that s/he doesn't know what s/he's asking for?

If there is a good reason for this, the more reasonable approach is probably to process the message in Word afterwards. (Instead of mailing the file from Progress, deposit it on a PC where a client application can pick it up, format it, and mail it. You'd need to reference Word and the CDO object library.)

(Any sarcasm in this message is NOT directed at the participants in this discusssion.)
 
I had to do something like this and output the report in HTML, then emailed it to the users. One user had Outlook 95 which doesn't understand HTML. I had to attach the HTML as well as include it in the email so that user could open the attachment in IE (or word or whatever) to view the report.

You can also do PDF - there's some free Progress code on how to do this at although their site appears to be having webspeed issues at the moment. I've not used this, but I know many have and say it works very well. You could do this from AIX.

Recently I re-wrote a Crystal report in Progress and didn't use fonts, just a normal Progress report. The user hated it because of the look. All of the information was there just fine, but they threw such a fit that I had to change it. Oh, well, I learned some new things while doing that. :)

Rich
 
The user hated it because of the look. All of the information was there just fine, but they threw such a fit that I had to change it. Oh, well, I learned some new things while doing that.

I hope one of the things you learned is that when your users value style over substance, get a big stick and beat the cr@p out of them. Or just give them cr@p but make it look pretty.

Oh, I'm ranting, aren't I... :)
 
ranting... yes.....speaking the truth...yes
(remember the mantra ...customer is always right...the customer is always right even if they are wrong)

Faelcu, your original request is flawed....

"email a text file" and "formatted as Word .Doc" are not the same thing.

you could email a word .doc file as an attachment.
your progress application would have to create the output file in the appropriate format.
 
Oh I ranted plenty and started down the hall with my big stick, but then remembered I like being employed, so I went back to my desk. ;)

It wasn't that hard to give them what they wanted and something I needed to learn anyhow, so I didn't mind TOO much.


Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top