S
Saeed
I am newbie to VBA, and would like to know if the following can be done
using VBA with Word.
A word document is to be used as a report template. The users may amend
the "boilerplate text" to their tastes, but not the merge data place
holders (terminology?).
The document is a mixed of single items and repeating row items, as
illustrated by the following example:
OWNER: _THE_OWNER_
ADDRESS: _THE_ADDRESS_
RESIDENTS
NAME DOB GENDER
_THE_NAME_ _THE_DOB_ _THE_GENDER_
(repeated for each database row)
RESIDENCE LAYOUT
ROOM SIZE USAGE HEATED DOUBLE GLAZED
_THE_ROOM_ _THE_SIZE_ _THE_USAGE_ _THE_HEATED_ _THE_DOUBLE_GLAZED_
(repeated for each database row)
INSPECTION NOTES: _THE_INSPECTION_NOTES_
INSPECTED BY: _THE_INSPECTED_BY_
INSPECTION DATE: _THE_INSPECTION_DATE_
All items in relate to a single database row other than those in the
tables marked above as "repeated for each database row".
I cannot use normal Word Mail Merge because I need 3 data sources, 1 for
the single items and one for each table above - I could use mail merge
if I flattened the returned data out to make a single data source, but
that would be well messy and there has to be a neater way.
Having searched the internet for info I have concluded that this can be
done using VBA, but what I need is an example of such a mail merge that
I can use as a proof of concept for input into the design stage.
I am using Office 2000.
Saeed
ng_786
using VBA with Word.
A word document is to be used as a report template. The users may amend
the "boilerplate text" to their tastes, but not the merge data place
holders (terminology?).
The document is a mixed of single items and repeating row items, as
illustrated by the following example:
OWNER: _THE_OWNER_
ADDRESS: _THE_ADDRESS_
RESIDENTS
NAME DOB GENDER
_THE_NAME_ _THE_DOB_ _THE_GENDER_
(repeated for each database row)
RESIDENCE LAYOUT
ROOM SIZE USAGE HEATED DOUBLE GLAZED
_THE_ROOM_ _THE_SIZE_ _THE_USAGE_ _THE_HEATED_ _THE_DOUBLE_GLAZED_
(repeated for each database row)
INSPECTION NOTES: _THE_INSPECTION_NOTES_
INSPECTED BY: _THE_INSPECTED_BY_
INSPECTION DATE: _THE_INSPECTION_DATE_
All items in relate to a single database row other than those in the
tables marked above as "repeated for each database row".
I cannot use normal Word Mail Merge because I need 3 data sources, 1 for
the single items and one for each table above - I could use mail merge
if I flattened the returned data out to make a single data source, but
that would be well messy and there has to be a neater way.
Having searched the internet for info I have concluded that this can be
done using VBA, but what I need is an example of such a mail merge that
I can use as a proof of concept for input into the design stage.
I am using Office 2000.
Saeed
ng_786