View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
fscodave fscodave is offline
external usenet poster
 
Posts: 11
Default Mailmerge - Firstname truncate to Initial?...

That's /exactly/ the type of text manipulation I've been able to do in
WP in its merge language and have failed to figure out how to do in
Word. At least now I know not to waste my time.

I had a routine to reduce the full name of an insurance company to a
short name. (Like /Dominion of Canada/ to just /Dominion/.) And no, I
can't modify the merge field: I just get a .dbf file straight from IT.
I've been trying to figure out some way around Word's limitations. I
posted a message a while ago, and got a somewhat unhelpful answer to
forget what I could do in WP and move on to learn SQL or something.

WP has merge commands like ASSIGN(vTxt;FIELD(Txt)), to assign whatever
to the variable vTxt (in this case, a field), and string commands, so
then you can search for, say, the position of the first space with a
string position command like STRPOS(" ";vTxt) and combine it with a
substring command to subtract the bit you want and assign that to your
variable.

Sigh.

Is there no way to invoke VBA? You know, somehow assign that field with
the name to a variable, then invoke VBA to manipulate it, then insert
the modified variable into the document? Again, I've done that with
fields where I get want the user to be able to modify the info if need
be, but not necessarily. [The routine is: 1. assign field to variable..
2. invoke macro with prompt where variable pre-fills the prompt. 3.
user can modify or not the variable. 4. macro stops, variable is
inserted into text in WP's merge language.]

But so far I haven't found the equivalent of WP's VARIABLE(vTxt)
command to insert the modified-or-not variable into the text...

David Evans

Peter Jamieson wrote:
I would go Graham's route, but if you cannot do that, you can probably have
26 IF fields that do e,.g.

{ IF "{ MERGEFIELD Lead_PersonFirstname }" = "A*" "A" ""
}{ IF "{ MERGEFIELD Lead_PersonFirstname }" = "B*" "B" ""
}

and so on...

Peter Jamieson
"Mark" wrote in message
...
Hi all,

I have a mail merge question, does anyone of you sage beings know how I
can
truncate Firstname (MERGEFIELD Lead_PersonFirstname) to its first
initial?

I.e. instead of showing Mark Ryan, showing M Ryan instead?

Many thanks for your help!