#1
|
|||
|
|||
Can I Use Two Formatting Elements In The Same Field
I have a mailmerge document using an Excel spreadsheet. In one field called LVMass (a number) I wish to do two things at the same time. Both can be done separately (and the examples below both work), but the question is can I combine both at the same time?
1. Format the number to two decimal places using: \# "0.00" 2. Set to bold if outside a range: {={MERGEFIELD LVMass}-201 \#"'{MERGEFIELD LVMass}';'{MERGEFIELD LVMass}'"} I have tried various ways to combine these without success. Is this possible? Thank you for any advice you can give. |
#2
|
|||
|
|||
bigukfan -
Give this a shot... Works for me in my document anyway. Had to read between the lines a bit so hope I interpreted what you need correctly. Assuming that you want to format all values as 2 digit decimal - Then to bold any LVMass value that is less than 200. {if {condition } < 200 {true_result} {false_result}} The formula would be: {if {MERGEFIELD LVMass} < 200 {MERGEFIELD LVMass \# "0.00"} {MERGEFIELD LVMass \# "0.00"}} Note that you have to put the picture switch in for both the true and false results to have all the values display with decimals. Also note that you have to insert the curly brackets - {} - using CTRL-F9 key combination. You can't just type them in. The bold formatting was applied after the whole formula was input using the bold key (CTRL-b) Hope that is what you needed! Scott Last edited by ScottA; 06-03-2014 at 05:39 PM. |
#3
|
|||
|
|||
Thanks
Thanks for your help ScottA, some very useful comments from you.
In further research it turns out formatting in Excel can be preserved in Word by connecting using DDE, which is a whole lot less hastle! A couple of clicks to specify DDE in Word and the rounding problem is not a problem anymore. More than one way to skin a cat as usual. Once again, thank you for your comments. |
#4
|
||||
|
||||
Hi bigUKfan,
Although DDE can preserve formatting, it's also a whole lot less capable than the default OLE DB provider Word 2002 & later use. For starters, with an Excel data source, it only works with the first worksheet and won't accept named ranges. The use of field switches also means your mailmerge output can be independent of the data format. Without that, you'd need have separate fields in the data source for every data format you wanted to use.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting formatting for field with email hyperlink | JenK | Excel | 2 | 02-13-2014 10:38 PM |
Merge Field Formatting | Welshie82 | Mail Merge | 4 | 10-08-2012 03:38 AM |
Text form field loses formatting in Word 2010 | mel72349 | Word | 0 | 08-02-2011 02:25 PM |
Sorting elements in a row | Riccardo | Excel | 2 | 12-14-2010 10:08 AM |
Text Form Field formatting problem | Toshii | Word | 1 | 06-08-2009 07:21 PM |