Checking the length of merge fields

M

Michael Herzog

I'm writing a template in Word for the Document Request
module of our Siebel installation. There are a lot of
filler first names of customers/prospects in the database,
so I try to sort them out while merging the document with
{IF { OR {MERGEFIELD FIRST_NAME_X} <> "-" ;{MERGEFIELD
FIRST_NAME_X} <> "/";{MERGEFIELD FIRST_NAME_X} <> "."}
{MERGEFIELD NUON_CONTACT_FULL_NAME_X} {MERGEFIELD
LAST_NAME_X}}.

Of course this only works for the defined filler values
and your coworkers can be very creative with those.

A more elegant way would be to check the length of the
merge field FIRST_NAME_X and only print
NUON_CONTACT_FULL_NAME_X if the length of FIRST_NAME_X is
=> 2.

Is this possible?

If want to implement a similar thing in the other modules,
but they don't use merge fields, they use references like
{REF SalesRep\*MERGEFORMAT\Charformat}.
 
C

Cindy Meister -WordMVP-

Hi Michael,

Unfortunately, Word has NO string manipulation capabilities
in its fields. You don't mention which database format the
data source is in, but one possibility would be to use
functions in the SQL to pre-process the data. Maybe an
additional expression that carries the LEN information.

Word can support such functions in its QueryString property
to a certain extent, if the connection method for the data
source supports them. For example, JET does, but for plain
text files, you can't do it.

I notice you may be German-speaking? On the Microsoft Word
Das Profibuch CD from MSPress there's an "IMPconverter" that
Peter Jamiesion developed that has this functionality built
into it. You use it in an IncludeText field, and the
converter processes this and returns the result for the
merge field.
A more elegant way would be to check the length of the
merge field FIRST_NAME_X and only print
NUON_CONTACT_FULL_NAME_X if the length of FIRST_NAME_X is
=> 2.

Is this possible?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan
24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
M

Michael Herzog

You don't mention which database format the
data source is in, but one possibility would be to use
functions in the SQL to pre-process the data. Maybe an
additional expression that carries the LEN information.

I have no idea, I think some Oracle solution.
There is just a "Generate Document" button in SIEBEL (in
case you don't know it, it is a very popular CRM solution
in the states)and clicking on it is everything I can do.
Changing something in SIEBEL is expensive and takes time,
so I just have to live with this solution.
I notice you may be German-speaking?

True. ;)
 

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