| James J. Gavan 2006-02-28, 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: 113
Date: Tue, 28 Feb 2006 23:48:59 GMT
NNTP-Posting-Host: 64.59.135.176
X-Complaints-To: abuse@shaw.ca
X-Trace: pd7tw3no 1141170539 64.59.135.176 (Tue, 28 Feb 2006 16:48:59 MST)
NNTP-Posting-Date: Tue, 28 Feb 2006 16:48:59 MST
Organization: Shaw Residential Internet
Xref: number1.nntp.dca.giganews.com comp.lang.cobol:156175
2jo wrote:
> 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?
>
2jo - Have your resolved this yet; if not, I'm working on a solution
which *might* be about 90% there - so far.
Just a side note - somebody posted a thread here recently, "Is it Just
Me ?". I didn't comment, but it wasn't just HIM. He could have written
50 components in the time it has taken me to get a handle on MS Word
!!!! Bearing in mind these Microsoft tools are designed to be used by
non-programmers - God help them ! The trouble is, there are so many
permutations and in the case of mail-merge, MS let's you even do "IF
tests ..." from within MS Word.
2j0 - back to your own query, take a look at these :-
Overview of Mail-Merge :-
http://office.microsoft.com/trainin...=RC011205671033
Mail-Merge Quick Reference card - last part of the above :-
http://office.microsoft.com/trainin...=RC011205671033
I tried to print the Quick-Reference and lost the bottom part. Copy and
paste it into MS Word and then print it from there.
Some questions :-
1. You database is it a COBOL ISAM or a DB Table you were getting your
address info from.
2. Or are you extracting data using VBA ?
3. If a DB which one. It appears if you have an ODBC Driver then for
mail-merge, MS Word can reference your DB. (naturally MS lets you use
Access, Excel and Outlook). From the Quick Reference you are *supposed*
to be able to use a CSV (comma separated variable) text file = COBOL
Line Sequential. It would be real nice if they told you *exactly* HOW !
4. If you are already familiar with MS Access - then that could be used,
because that's one of the features MS Word can use for a merge list.
Even if you are not familiar with MS Access I can quickly "tutor" you on
it using the Micro Focus ESQL Assistant and quickly give you the SQL
code to write to the MS Accesss Table MS Word needs.
5. If you would prefer to stay with the CSV file approach - then you
have got to do some homework. Go to the MicroSoft site and spend *hours*
searching for 'How to' with MS Word; articles, Knowledge Base and there
might even be user groups. If you have any luck, I want you to find out
so that you can tell me, STEP by STEP, the answer to the following :-
Question 1 : "How do I use a text/CSV file as my 'Data File' containing
the merged data I want in my Master Document(Letter). AND how do I go
about identifying the different column fields in my text file ?".
Question 2 : "If I have columns in my Address Block, where the
State/County might be missing for certain records, how do I avoid the
merged letter printing out a blank line ?"
With reference to above there are three features to merging with MS Word :-
a) The Master copy of the letter you want to send
b) contained in (a) a reference to the format of the records in (c)
c) Your list of merge fields - a record equals One Row and the Columns
within that record are the various fields you want to merge. (You will
see in their references that the record is a 'paragraph' terminated by
<ENTER> key. Talk about confusing - what they are really saying is a Row
of information (a record) is terminated by <ENTER> and then there is a
BLANK LINE before the next record !)
Briefly an outline using (a) above :-
------------------------------------------------------------------------------------
My Company Name
My Company Address
Date format
<<Address Block>>
<<Greetings>>
Document Title
Now we start our text here ........ the meeting will be held at << a
merged field>> and the date and time of the meeting is << a merged field[color=darkred]
Yours faithfully,
MyName and Title
-----------------------------------------------------------------------------------------
Where I have chevrons above << >> these are fields from the columns in
your text file or MS Access Table. No searching with 'pointers' - setup
the 'Data File', specify which columns appear between the chevrons,
merge and print ! Haven't quite figured the automatic 'merge and print'
- will have to go checking that Type Library Assistant file to locate
the necessary methods.
Jimmy
|