tab and return in mail merge

M

mardukes

I'm mail merging from Dynamics CRM. Some of the fields I send over to Word
have tabs & returns in them - multiple lines. However, the delivery process
strips them out leaving spaces. I've tried the ^t & ^p and it solves the
stripping but Word just prints them instead of interpreting them.

Are there mail merge tokens that interpret as tab and return while merging?
 
P

Peter Jamieson

Could you provide a few details about how you do this with Dynamics -
e.g. do you export a file - if so, what filetype/format options do you
have - or do you connect Word to a data source within Dynamics, in which
case what type of connection is it? Or what?

FWIW if you have a plain text file with fields surrounded by "", Word
should handle both tab and newline characters correctly. It doesn't seem
to care whether the newlines are the proper "Windows" standard CRLFs or
the Unix world's LF-only standard, although it may ask more questions if
you use the latter.

Peter Jamieson

http://tips.pjmsn.me.uk
 
M

mardukes

I wish I could tell you more but not even anyone at CRM can describe it to me.

All mail merge templates have be saved as Word xml. So I assume the CRM
server instantiates the xml. The stripping has to be in Dynamics because I
just got a hotfix that cured the end-of-line issue. Since I have little hope
that they will go back into that fix and extend it to the tabs, I am hoping
there is a mail merge constant of some sort that I could imbed. (E.g. {tab})

My secondary hope is that someone can point me to the documentation (this is
clearly not a VBA question) for "mail merge programming" so that I could look
into it myself.
 
P

Peter Jamieson

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
 
M

mardukes

I thank you and I do appreciate the puzzlement. No one seems to know what's
going on.

I don't know about Content Control facilities and I don't see where the .net
programming is (probably all server side) but it is XML that we're talking
about.

My "template" is saved in Word XML format. When I open it in word it looks
like the original mail merged document. When it comes up (in Word) via the
CRM call to merge it looks like merge fields.

There is quote template out there that is refered to as "directory" vs
letter, email etc. Assumedly this means a single document has repeating
lines -- multiple product items/qty/prices for one customer. The mail merge
"code" has program flow control (if statements) and structure beyond merge
fields. It is a reference to this language that I am seeking; I'm not
convinced it is VBA.
 
P

Peter Jamieson

OK, the language you refer to does not have a name, although I think of
it as the "Word Field Code language"
There is quote template out there that is refered to as "directory" vs
letter, email etc. Assumedly this means a single document has repeating
lines -- multiple product items/qty/prices for one customer. The mail merge
"code" has program flow control (if statements) and structure beyond merge
fields.

If that is the kind of merge application you are attempting, I suggest
you go straight to macropod's tutorial on the subject, which is at

http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=731107

I quote macropod:
<<
Do read the tutorial before trying to use the mailmerge document
included with it.
Otherwise, aspects of the language are partially documented in Word Help
- Word 2007 is pretty useless on that front, however. Word 2003 is much
better. But you will also find a lot of the same Word 2003 stuff at

http://office.microsoft.com/en-us/word/CH060832471033.aspx

Don't look for the kind of stuff you might expect with a procedural
language such as VB (data types etc.) it isn't really there. Just bear
in mind that the Field Code language has a number of different things
that can be used as "variables" { MERGEFIELD } fields, Word bookmarks
(you can either mark them in the text or use { SET } fields to create
them), and stuff such as { DOCPROPERTY } or { DOCVARIABLE } fields.

The Field Code language has many quirks. You may find it useful to plug
into the microsoft.public.word.mailmerge.fields group (on Microsoft
Communities it is called Mailmerge & Fax) and/or get used to using a
search engine such as google groups to search it.

Peter Jamieson

http://tips.pjmsn.me.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top