| James J. Gavan 2006-02-23, 6:55 pm |
| In-Reply-To: <1140703065.787784.193780@g44g2000cwa.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 57
Message-ID: <RWqLf.65807$H%4.56395@pd7tw2no>
Date: Thu, 23 Feb 2006 22:46:09 GMT
NNTP-Posting-Host: 64.59.135.176
X-Complaints-To: abuse@shaw.ca
X-Trace: pd7tw2no 1140734769 64.59.135.176 (Thu, 23 Feb 2006 15:46:09 MST)
NNTP-Posting-Date: Thu, 23 Feb 2006 15:46:09 MST
Organization: Shaw Residential Internet
Xref: number1.nntp.dca.giganews.com comp.lang.cobol:156040
2jo wrote:
> thanks for the answer
> just for your information Michael Mattias it's not my first COBOL
> program and i know how to use 'CALL' in COBOL
> what i've said it's just exemples in VBA...
>
> i realize that it's not possible to do this on that way
>
> so i change the way to do the traitment
> i scan the word document and i change words or expressions
> it's OK when it's text but what i need to change is merge fields
> to change only text the instruction is :
> invoke theFind "setText" using by content unevar
>
> and to change mergefield???
>
> example : i've my letter with mergefield like "name" "city" "address"
> ...
> and i want to replace these ones by values i've chosen ("city" ->
> London, "name" -> Lee, ...)
> but i can't
> what the instruction in cobol to do this?
>
I've read your messages and Michael's replies. I appreciate you are
probably very comfortable with VBA - but I liken it to taking a crusty
baguette and making a sandwich with Brie and Roquefort - the blue cheese
more than somewhat negates the taste of the Brie. (I'm a great French
cheese lover by the way :-) ).
Wasn't quite clear on your use of the word 'macro' - thinking back to
old DOS days, (in text mode), when with a couple of keystrokes you could
generate useful macros. (That is also how the old Wang word processing
computers used to work). But I understand your example.
Perhaps you can do what you want - but it does appear to negate the
usefulness of the MS Word mail-merge technique.
One approach you could take - make your 'original' letter just a
straight text file from any editor, with markers where you want the text
changed. Then using PC_PRINT routines you can use the features to
'dress-up' the text in good quality fonts, underlining, bold etc. Plus
PC_PRINT allows you to set your printer. But that appears to me a
long-winded way of doing it.
Although I work solely in OO COBOL I can't immediately think of how you
can search for your city marker and substitute 'London'. At best you
read in the original and write out a copy which now has the word
'London' for the particular output. (That output is a temporary object).
You keep going back to the original, search, output with replacements
and print. Now under the engine cover, that's *exactly* what MS Word is
doing with mail-merge without you getting involved.
If you concentrate on what MS Word can do, then you are only faced with
the problem of setting the appropriate printer prior to your COBOL
program accessing MS Word.
Jimmy
|