Mail Merge / Macro question

O

Office_Novice

Heres the thing, I have a form letter where all the information is provided
from a database via mail merge. This works, I am now trying to write a macro
to mask the Tax ID fields first 5 or so characters any ideas i was thinking
somthing like

Sub MaskTaxID()
With ActiveDocument
.Fields.Unlink
Left(.Fields("Tax_Id_1"), 7) = "xxx-xx-"
.Fields("Tax_Id_1").Update
End With
End Sub

But this isnt right Any help would be super.
 
M

macropod

Hi Office_Novice,

If the Tax ID is a simple number, then a formula field inconjunction with your mailmerge can be used to mask any given number of
digits. For example, if a field coded like:
{=MOD({MERGEFIELD Tax_ID},10000) \# 0000}
would display only the last 4 digits. You could then prefix the mergefield with as many Xs etc as you need.

If the field is formatted like ##-## or ##-##-## (the number of digits isn't important), see the parsing technique I've developed in
my Word Field Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Parse Numbers Separated by + Or - Signs'. Note: A syntax error occurs in the fields in the
above document because it isn’t performing a mailmerge.
 

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