How to mask first 4 digit number - Mail Merge
-
Monday, December 10, 2012 3:28 PM
Is it possible to mask the first 4 digits in a Mail merge formatting switch so that, instead of the field showing as 01234567, it shows as xxxx4567.
- Edited by adcz250 Monday, December 10, 2012 3:33 PM
- Moved by Vicky Song Friday, December 21, 2012 4:19 AM (From:Word for Developers)
All Replies
-
Monday, December 10, 2012 3:51 PMNo, I don't believe that's possible using Word's built-in functionality / formatting switches. It would require a macro run on the mail merge result document.
Cindy Meister, VSTO/Word MVP, my blog
- Proposed As Answer by Quist ZhangMicrosoft Contingent Staff Tuesday, December 11, 2012 10:57 AM
- Unproposed As Answer by Cindy Meister MVPMVP Tuesday, December 11, 2012 3:19 PM
-
Monday, December 10, 2012 3:53 PMHow abt in access database. would it be possibe do in query
-
Monday, December 10, 2012 4:11 PM
I don't think so, but <ou'd need to ask this in the Access for Developers forum to be sure. The Access help on number formatting doesn't include anything like that.
When you'll ask you'll want to be sure to mention this is to run with mail merge. It is possible to set up Access queries to run code, but that only works with mail merge if you use a DDE connection.
Cindy Meister, VSTO/Word MVP, my blog
-
Monday, December 10, 2012 10:02 PM
In the simple case where the numbers are all 8 digits, how about putting the following in your Mail Merge Main Document:
xxxx{ =MOD({ MERGEFIELD mynum }, 10000) \#0000 }
Where mynum is the name of your merge field, and all the { } are the special field cod3 braces that you can insert using ctrl-F9
Peter Jamieson
- Marked As Answer by adcz250 Tuesday, February 19, 2013 4:43 PM
-
Thursday, December 20, 2012 9:00 AM
Hi Adcz250,
Thank you for posting in the MSDN Forum.
According to your description, your issue is an non-development related issue. I suggest you repost it on the Word Answers Forum.
Experts there are more familiar with the usage of Word and may give you more suggestions.
Best regards,
Quist Zhang [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

