Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Formatting in MS Word 2003 Table

Status
Not open for further replies.

SQLBI

IS-IT--Management
Jul 25, 2003
988
GB
Hi,

I have a table within my Word 2003 document that i want to conditionaly format some of the cells based on their contents.

the problem i have is that this document is used for a mail merge and therefore i cant simply insert an excel object and use Format > Conditional Formatting.

I'm sure i read somwhere that it was possible to format in word using an IF...THEN...ELSE condition bit i cant find any way of doing it within the document.

Would this have to be done in VB and if so, is there a 'OnMergeRecordChange' event/method that would do it?

Any suggestions would be much appreciated.



Cheers,
Leigh

Sure, if it has a microchip in it, it must be IT... Now what seems to be the problem with your toaster...?
 
I think you will have to use VBA.

I do not think there is a OnMerge event. The cells will have the information value derived from each merge. I am pretty sure this would have to be a post merge event. I do no think it would be particulalrly difficult to do it though.

Please post in the VBA forum. We can help you there.

Gerry
 
Whey-hey, managed to get it working!!!

To all who may be having the same problem, here's how to do it.

In my Word doc, i pressed Alt+F9 to display the 'MERGEFIELD' text of my mailmerge fields. Then, by adding an If...Then...Else 'Word Field' i was able to define my conditions and modify the formatting etc.

This example displays the return value of the mergefield red:

{ IF { MERGEFIELD Next_Vaccine } = Overdue "[red]Overdue[/red]" { MERGEFIELD Next_Vaccine } }

NB: For reasons unknown, you can't just type the text, you must 'Insert Word Field' and then modify the code using Alt+F9.

Hope this helps anyone else struggling with the same scenario.




Cheers,
Leigh

Sure, if it has a microchip in it, it must be IT... Now what seems to be the problem with your toaster...?
 
that would make sense as word is a word processor and meant to recognise anything typed as text !

Laters, phat, headshape
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top