none
How to mask first 4 digit number - Mail Merge

    Question

  • 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.


    Monday, December 10, 2012 3:28 PM

Answers

  • 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
    Monday, December 10, 2012 10:02 PM

All replies

  • No, 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

    Monday, December 10, 2012 3:51 PM
  • How abt in access database. would it be possibe do in query
    Monday, December 10, 2012 3:53 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 4:11 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
    Monday, December 10, 2012 10:02 PM
  • 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.

    Thursday, December 20, 2012 9:00 AM