Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
[email protected] jared.hildebrandt@gmail.com is offline
external usenet poster
 
Posts: 1
Default Masking Social Security # in a Word merge doc

Hi all,
I am trying to mask a SSN to look literally like this XXX-XX-1234 or
some other combination where most of the numbers are X'ed out. I
couldn't find any easy way to do this in Word, I am alos kinda new to
the merge docs. Any help would be great!

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Masking Social Security # in a Word merge doc

The best and safest way to do this is to modify the data source in some way
so that instead of (or as well as) receiving a field with (e.g.) 123-45-6789
in it, you also receive 6789 and prepend that with XXX-XX- use that directly
where the SSN needs to be partially hidden.

How to do that depends on the data source (what is it?), but for example if
the SSN is stored as a string in Access, all you really need do is create a
query that creates a new column using something like right(ssnfield,4) and
use that as the data source for the merge. Prcisely how to do that depends
on how consistent the SSN format is - if it is invariably xxx-xx-xxxx then
it's straightforward.

Peter Jamieson

[
Most other methods require that you obscure the SSN in some way, and the
trouble with that is that it may look obscured in print and on screen, but
if you merge to new documents or to e-mail, the full SSN may be sitting
there as plain as day.

However, because the digits in fonts all have the same width (well, usually,
anyway) you might be able to use use something like

{ MERGEFIELD ssnfield }{ ADVANCE \l 70 } { ADVANCE \l 40 }XXX-XX-{
ADVANCE \r 30 }

where
a. all the {} are the special field braces you can insert using ctrl-F9
b. the characters between \l 70 } and { ADVANCE are block characters, e.g.
the Unicode FULL BLOCK character no. 0x2588 (hex 2588) that you can insert
using Insert|Symbol - select them and use Format|Font to apply White colour.
These are used to blank out the digits before "-5678" completely before
inserting the "XXX-XX-" mask.
c. you will need to adjust the font and size of the block characters, the
XXX-XX- "mask", and the numbers in the ADVANCE fields

You might also be able to do something using a nested EQ field, e.g.

{ EQ \o\al\({ MERGEFIELD ssnfield }, ,XXX-XX-)}

where the spaces between , , are also block characters coloured white, as
above, and you would need to adjust the sizes of everything to make it work.

But personally, I would avoid all methods that do anything like that for the
reason I've stated.
]

wrote in message
ps.com...
Hi all,
I am trying to mask a SSN to look literally like this XXX-XX-1234 or
some other combination where most of the numbers are X'ed out. I
couldn't find any easy way to do this in Word, I am alos kinda new to
the merge docs. Any help would be great!



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
J-Rod J-Rod is offline
external usenet poster
 
Posts: 1
Default Masking Social Security # in a Word merge doc

Thanks Peter. I believe that my data is coming from a stored
procedure, so i may be able to modify the query as you suggested. The
spec changed a little from what i had originally and being that i am
new in word merge, what ways could i use to format it 123-45-xxxx? If
you could give me an alternative or two that would be great. I will
try to modify your examples that you already gave me and see if i can
figure it out as well.

  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Masking Social Security # in a Word merge doc

new in word merge, what ways could i use to format it 123-45-xxxx? If

1. "Change the query" approach: use e.g. left(ssnfield,6). Actually I think
if you are using SQl Server you need something more like
substring(ssnfield(1,6) or some such.

2. "Use ADVANCE fields" approach. start with something more like the
following and adjust

{ MERGEFIELD ssnfield }{ ADVANCE \l 50 } { ADVANCE \l 50 }-xxxx

3. "Use EQ field" approach. Try something more like

{ EQ \o\ar({ MERGEFIELD ssnfield }, ,-XXXX)}

(NB I think I put an extra \ in the earlier example after al where there
should not be one)

4. You can also consider putting the field in a table cell or frame with a
fixed width and height, so that the right 4 digits are truncated. Then (if
you can) put the -XXXX immediately afterwards. (Frames are the predecessors
of "Text boxes" in Word and are typically more reliable when you're using
merge fields. You can create them by opening Tools|Customize|Commands,
select category All Commands, locate the InsertFrame command and drag it to
a toolbar, then use that. Or create a textbox, select it, right-click,
Format Text box, Text box tab, Convert to frame.

Again, personally I think (1) is the simplest and safest approach. However,
you do not necessarily have to have special access to your database to do it
because you can use a Word VBA OpenDataSource method to issue SQL, e.g. if
your data is coming from a view called myview, the SQL might be something
like

SELECT [m].*, substring([m].[ssnfield],1,6) AS `partialssn` FROM [myview]
[m]

Peter Jamieson

"J-Rod" wrote in message
oups.com...
Thanks Peter. I believe that my data is coming from a stored
procedure, so i may be able to modify the query as you suggested. The
spec changed a little from what i had originally and being that i am
new in word merge, what ways could i use to format it 123-45-xxxx? If
you could give me an alternative or two that would be great. I will
try to modify your examples that you already gave me and see if i can
figure it out as well.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reveal codes in a word document FUN101 Microsoft Word Help 4 May 16th 23 08:47 PM
Why dont MS just f**king re-write Word from scratch? Its dogsh*t Word Hater Microsoft Word Help 33 May 5th 23 02:52 PM
How to put graphics on envelopes? Steve Koenig Microsoft Word Help 21 April 29th 23 02:47 AM
Word & WordPerfect MrsMac Microsoft Word Help 5 June 10th 06 03:14 AM
How can Word display full path of a file in the title bar? SAsif Microsoft Word Help 1 January 26th 06 04:32 PM


All times are GMT +1. The time now is 08:08 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"