Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Piscataway, New Jersey, USA
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi everybody:

    I've inherited a template with a Word 2003 table that serves as an order form. The user types in the number and price of items to order and the table fields compute sales tax, add in the shipping costs, and produces a grand total. The last column of each row contains fields to multiply the number of items by their cost, and the bottom rows sum things up. The results are formatted as currency. Fine.

    I put a button on the Grand Total cell for the user to update all the fields before printing or emailing the form, since Word doesn't do that automatically.

    Now, my boss wants not to see the $0.00 amounts that show up in the last column of each row when an order has not been entered on that row. So, I'd like to conditionally format these cells. My thought was to add some simple code to the Total button that when looping through the fields to update them would also set their cell fonts to white if their result = 0, black otherwise. Can't find in the Word object model a way to get the cell references for a field in a table.

    Thank you, in advance, for your help.

    Kathryn

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you have a field fld, you can use fld.Result to return the range of that field, or if you prefer the entire cell, you can use fld.Result.Cells(1).Range

    For example:

    fld.Result.Cells(1).Range.Font.Color = wdColorWhite

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Piscataway, New Jersey, USA
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, Hans! I knew you would know.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •