#1
|
|||
|
|||
Making Bold Using 'IF'
I recently posted a question about making a font Red and Bold by the use if conditional formating in a mail merge. I did receive a useful reply from one user of this forum pointing out the issue was spaces. It was also suggested I could use an alternative syntax.
The original syntax with correct spaces is: {IF {MAILMERGE HR}>80 {MAILMERGE HR} { MAILMERGE HR}} Once I sorted out the correct spaces, this worked. However, using the exact syntax with the correct spaces it does not work for any other field. For example: {IF {MAILMERGE QRS} >15 {MAILMERGE QRS} {MAILMERGE QRS}} It was also suggested I could use the following syntax: {={MERGEFIELD PR}>199 \#"'{MERGEFIELD PR}';'{MERGEFIELD PR}'"} Using this syntax I do not get the error I was getting but I also do not get the bold if the value is greater than that quited. Anybody have any ideas where I am going wrong? The mail merge is linked to an Excel file, Word 2010, Excel 2010, Windows 7 and Windows 8 PC used. Thank you for any advice |
#2
|
||||
|
||||
You have the wrong syntax for the second and third versions. See: https://www.msofficeforums.com/mail-...html#post60240
For the second version, the syntax is not '} >15' but '}> 15' or '} > 15'. For the third version, the syntax is not '}>199' but '}- 199' or '} - 199'. Word is very particular about the minimum space requirements.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Once again macropod thank you for your help.
I agree, Word is very particular about spaces. I come from a programming environment working mainly in databases both large and small and spaces are not such an issue there! I'll try not to waste any more of your time. Thank you. |
#4
|
||||
|
||||
I'm sure your other programming environments would fail, too, if you used code like:
IF MyVar = XThenY Most IDEs have the intelligence to insert the spaces either side of a mathematical operator for you, but can't handle errors such as with the lack of spaces either side of the 'Then' in the above. With Word field's you're the IDE.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Not Bold text but it comes up bold | Pluviophile | Word | 7 | 10-22-2013 10:29 AM |
Format Bold in one line makes all lines bold | Nitte | Word | 2 | 02-07-2013 12:34 AM |
Making Line Bold | janith | Word VBA | 5 | 05-30-2012 04:04 PM |
Making Multiple Words Bold | mtk989 | Word | 2 | 06-25-2011 11:27 AM |
Can't use Bold and Italic | khmerguy | Word | 3 | 03-31-2011 12:48 PM |