View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Only displaying part of a merged field/formatting parts of a merge

1. It's difficult to make suggestions about how to proceed without know a
bit more about how Word is getting its data and what programming options you
have. e.g.
a. which version of Word can you rely on?
b. can you use VBA macros?
c. can you modify the data source as Word sees it? (what type of data
source does Word think it is dealing with

I have several document templates that have reference codes (they work the
same as merge field codes)


d. only Merge Fields really work the same as Merge Fields. With almost any
other approach, some application must be stuffing the data into the merge
fields and that would typically be an opportunity to alter what is inserted.

For a numeric value, you may be able to do what you want using fields and
formatting switches - in this case you could start with

{ =int({ MERGEFIELD myfield },1000000000000) \#"0000 **** **** " }{ =mod({
MERGEFIELD myfield },10000) \#0000 }

where each pair of {} are the special field brace characters you can insert
using ctrl-F9. However, there can be problems working with numbers with this
many digits and you should test that the mod() function in particular works
with any value you throw at it.
--
Peter Jamieson
http://tips.pjmsn.me.uk

"Andy" wrote in message
...
eld differently...

The software i use is web-based and all the information stored against a
customer has a reference that can be used to pre-populate information on
any
documents generated via the application.

I have several document templates that have reference codes (they work the
same as merge field codes) and, when the document is generated, pick up
the
information stored in those fields for the particular customer i am
dealing
with.

In some instances, for example credit card number, I only wish to display
part of the merged field in my document without having to alter the stored
data.

i.e. Number stored 1234 1234 1234 1234
currently populated 1234 1234 1234 1234
would prefer 1234 **** **** 1234

I am using Word 2003 SP2.