MERGEFIELD : Word 2010

Posted on 2012-09-08
Last Modified: 2012-09-11
i want to format the below text from mergefield to show the values without decimals

"NBT 2.0408%"

i tried the below code, but it does not seem to work

MERGEFIELD  TaxCode \#"#,##0.00;(#,##0.00)" \* MERGEFORMAT

there are strings and numbers on the field TAXCODE. how can i take off the decimal  numbers.
Question by:mugsinc
    LVL 76

    Expert Comment

    Word's fields can't apply numeric formatting to a field with text in it.

    You will have to divide the field into a text field and a numeric field in the datasource or query if you want to use numeric formatting on the numeric part.

    Of course, it would probably be simpler to remove the unwanted part of the numerics in the datasource.
    LVL 1

    Author Comment

    i dont have control of the data, is there anyway i can use an IF Statement to replace the field
    LVL 76

    Accepted Solution

    There is an IF field, but I don't know if any way to use Word fields to split the data.

    If you can get read the data with the merge, you should be able to manipulate it, perhaps with a query or by saving it in an intermediate file. What type is the data source?
    LVL 1

    Author Comment

    The if field worked. But I couldn't split it. But since I knew the values it worked

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
    Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
    This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
    The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now