Sorry, I missed your reply. If you're still here,
1. I am wondering what you mean by a "template" in CRM. In Word we
generally mean something quite specific - in effect a document in a
format designed to be used to make multiple copies of itself. In your
scenario, it sounds like even the data document is regarded as a template.
2. On the subject of "mail merge programming", traditional Word mail
merge really consists of the following things:
a. designing your data source
b. designing your mail merge main document (another thing I would
think of as a "template" even if it is not strictly speaking a Word
template)
c. connecting the mail merge main document to the data source
d. defining any additional sorts/filters (ideally done in (a))
e. defining where the output should go
f. manipulating the merge output during the merge
g. (possibly) manipulating the merge output after the merge
You would typically need to program the Word object model to do at least
(c) - if anything complicated is involved, (f) and (g). VBA is one way
to do that. But mostly, you should try to avoid the necessity do do that
by getting (a) and (b) right. Unfortunately for security reasons you may
end up having to do (c) in code.
Another possibility is that CRM is oriented towards the newer Word 2007
"Content Control" facilities. In that case, the expectation would
probably be that you insert COntent Controls connected to an XML data
store defined in the .docx/.docm file, and have code - probably in a
..NET language - to populate the data store one record at a time and
generate the "tear-off copies" you need, cf. a merge.
But without getting more info about CRM, I'm stuck...
Peter Jamieson
http://tips.pjmsn.me.uk