Changing color of a table cell in Words

Hi folks,
I’m new to this forum and ASPOSE as well… I’m learning on usage with Aspose.word… can any one of u assist me on how to change the color of a cell of a table (MS Word 2003)?? any help will be appreciated… thanx a lot once again
Shiva

Hi

Thanks for your inquiry. You can use CellFormat.Shading to achieve this:
https://reference.aspose.com/words/net/aspose.words.tables/cellformat/shading/
Here is simple example:

// Open document
Document doc = new Document(@"Test001\in.doc");
// Get table
Table tab = doc.FirstSection.Body.Tables[0];
// Set background color of some cell
tab.Rows[1].Cells[3].CellFormat.Shading.BackgroundPatternColor = Color.YellowGreen;
// Save output document
doc.Save(@"Test001\out.doc");

Hope this helps.
Best regards.

Hurrayyyy,
It really worked! thank you… Will get back to you if i need any other details :-). Once again thanx a lot…

A post was split to a new topic: How to Get background color of some cell in aspose word table?