View Single Post
  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Saving mail merge template not saving setting in address block

Actually we start in CRM, then open the template document and the fields
get
updated by the selection criteria in CRM.


To be honest, that doesn't tell me a whole lot about how the template is
actually working.

My guess is that merging from CRM is similar to initiating a merge from
Outlook, i.e.
a. CRM gets the data it wants
b. CRM creates a temporary file
c. CRM automates your template to connect it to the temporary data file
d. CRM leaves you with the mail merge main document open.

Does that sound about right?

If so, you will still definitely get the problem with the mappings, and it
may be difficult to fix that.

I've only had brushes with CRM and the impression I have is that it doesn't
make it easy to do the automation necessary to overcome this kind of
problem - e.g. there's no way to pick selected records from /some/ of the
dialogs and do your own automation to pick the necessary data from its
database and shove it out to a data file with a /fixed/ name that a Word
document can then pick up and use. My guess is that you may have to find a
less convenient way to produce what you need in this instance.

Peter Jamieson

"Luvsql" wrote in message
...
Actually we start in CRM, then open the template document and the fields
get
updated by the selection criteria in CRM.

"Peter Jamieson" wrote:

after word giving me an error because I am
not connected to my datasource which is generated directly out of CRM


OK, this seems to be the origin of at least some of the problems. If the
source is disconnected, you will lose those mappings. When you reconnect
to
the source, what do you choose? Is it a .odc that connects to a SQL
Server
file or are you choosing a text file of some kind exported by CRM? (I
don't
have a copy of the CRM stuff here)

Peter Jamieson
"Luvsql" wrote in message
...
If I open the template on its own (after word giving me an error
because I
am
not connected to my datasource which is generated directly out of CRM),
I
am
not able to right-click on the addressblock to see if the fields are
still
mapped or if the country flag is marked (needs datasource to do that).

I tried a merge just with Outlook contacts and it seems to retain this
info.
I guess it looks like CRM is overriding this information on the
template.

"Peter Jamieson" wrote:

OK, /here/, if I
a/ create a Label Mail Merge Document,
b. connect to a SQL Server data source
c. insert an ADDRESSBLOCK field in label 1 set to "Always include the
country/region in the address" and map one of the fields to something
different from the thing that Word automatically mapped it to
d. propagate fields
e. save as a .dot

then when I create a new document based on the template, the mappings
are
still there, the country is still there, and the main problem is that
the
same address appears in each label until you either do the merge or
move
records in preview (e.g. using the Mail Merge toolbar).

In other words, it seems to work more or less as you might hope.

So what could be different?...
When you open the template, or create a new document based on the
template,
is the data source attached? And is the type set to Labels? If not,
you
won't be able to propagate anyway.


How do you add a
switch to this window?


Assuming you are selecting the "Always include the country/region in
the
address" option in the Addressblock setup/edit dialog box, if you use
Alt-F9
to view the Addressblock field code, you should see something along
the
general lines of

{ ADDRESSBLOCK \f "various name and address specification
pseudo-fields
with
around them" \c 1 \d } and perhaps other stuff such as \e
"United
States of America"

If you can't see all of the text in the field because the table cell
is
too
small, you can copy/paste the field into a new document and have a
look
at
the field code in there.

While trying to get to the bottom of this, it might be easier to use a
"Letter type" merge document where you can inspect the ADDRESSBLOCK
code
more easily than you can in a Label cell.

NB, if the country flag is wrong in all the ADDRESSBLOCK fields, I
would
expect to have to re-propagate after fixing the problem in label 1.
But I
wouldn't expect to have to re-propagate if my mappings were wrong.

Peter Jamieson

"Luvsql" wrote in message
...
It is not different data sources. It is always CRM, which is SQL
Server.

I am positive that the country setting is not marked. How do you
add a
switch to this window?

I am positive that it is not applying it to the other fields as only
the
first label shows the country. If I go back, then right-click to
edit
and
mark the country for the second label, it then prints the country.
I
don't
want to have to do this for 2500 labels.

"Peter Jamieson" wrote:

If you need the users to be able to connect to different data
sources
and
you are therefore unlinking the data source from the document
before
saving
it as a template, you will lose any mappings you have set up (it
doesn't
really matter how you unlink the data source).

So yes, you do have to recreate the mappings when you attach a new
data
source. You may be able to simplify that by using a VBA macro, but
only
after the data source has been attached - in other words, you
couldn't
put
the macro code in an AutoOpen macro unless that also opened the
data
source.

However, I don't experience the same problem as you when I create a
new
document based on a template. Yes, I have to go into the mappings
again,
but
the ADDRESSBLOCK field is still set up to include the country. Are
you
sure
it is changing? (the option is stored as a \c 1 switch in the field
and I
don't see any reason that it would change)..

Further, the mappings are independent of any individual field, so
once
you
have edited the first ADDRESSBLOCK field, the others should apply
the
mapping also. It's possible that when you are previewing the change
isn't
immediately apparent.

i.e., I don't think you should need to propagate. But if I am wrong
and
you
do need to do that, you need to ensure that the document is set to
be
a
label type merge. If you unlinked the data source before saving the
doc/template, you probably turned it into "Not a merge document".
However,
if you enable the mail merge toolbar, use the first button to
seelect
the
label type merge, cancel out of the label dialog, then save the
document,
it
should be saved as a label type merge and the Propagate option
should
be
available.

Wish it was simpler. You can of course avoid ADDRESSBLOCK
altogether
and
use
individual merge fields nested within the necessary IF fields, and
avoid
mapping altogether.

Peter Jamieson

"Luvsql" wrote in message
...
We are using CRM and need to link certain fields in a mail merge,
plus
mark
the option to always include the country field. I can do this on
a
new
mail
merge, then update all labels, however, I need to save these
settings,
so
that the user printing the labels does not have to re-map the
fields
etc.
As
well, we wanted to save the specific label size and margin
settings,
so
we
need to save as a template.

When we use the saved template, the field mappings are back to
the
default
and the country is not marked. If I right-click on the first
one, I
can
re-map and mark to print the country, however, it only applies to
the
first
label and there is no update all labels. How do I apply this to
the
remaining hundred or so labels?