37
Views
13
Comments
[MSWordUtils] MSWordUtils: Assigning a color to the cell background
mswordutils
Web icon
Forge asset by Stuart Harris
Application Type
Reactive

Hello everyone, 

I have the following problem: 

I use the MSWordUtils component to create a dynamic table in a Word document. This table is dynamic at the column level, that is, it can have 1+ c columns. Therefore, I cannot define the template in the document, which would be easier. This table has to have some cells in a certain color (table layout attached). To do this, I use the MSWordCellFormat structure, specifically, the FillColor property. After publishing, I see that the color is not applied. Can anyone help me with this issue please? 

 Thank you. 

Table template 

Structure used


2022-12-22 10-00-39
Beatriz Sabino

Hi Diana,

Would it be possible to share an .oml with a sample logic you're applying? It would be easier than trying to replicate your use case.

2025-04-14 11-22-14
Aditi Saraswat

Hi @Diana Silva,

Can you please share the OML with the logic?


2021-07-29 06-38-13
Robert Roersch

Hello,

encountered the same issue. Want to set first row in my table to blue background and white letters.

Have tried several color codes, but the fill color and highlight color do not work.
When using the blue code for the text color, the text is set to this blue.

Attached a simple setup that I've used to test several options. 
Note: Text set to a different color to still see it when background remains white.

Regards, Robert


TestAppWordDoc.oml
2021-07-29 06-38-13
Robert Roersch

@Beatriz Sabino or @Aditi Saraswat have you been able to check my example or any other suggestions to get a solution?

2022-12-22 10-00-39
Beatriz Sabino

Hi Robert,

Have you had a chance to check out the demo for this component? There are two actions, “AddTable” and “AddTableColWidths”, which might be helpful for creating custom tables.

Also, from what I’ve seen, there’s an action called “MSWord_FormatTableCell” that you can use to format the cells within a table.

I’ll take a look at your .oml later today.

2021-07-29 06-38-13
Robert Roersch

Hello,

The "AddTable" is what we use in the logic.
When populating the cells, the format option FillColor is set for the cells where to add background color , including the font color.

The demo app uses table design styles to fill the header, but no control on what colors to apply.

“MSWord_FormatTableCell” requires a bookmark and we are not using a template where bookmarks are preset. The document and tables are build from scratch in our action. Using a template requires a complete redesign of current logic and making it complex.

As there is a cell format function as mentioned above, using that is preferred in our flow. So would be highly appreciated when that formatting would work.

Regards, RR

UserImage.jpg
Diana Silva

Hello, 

Exactly. I did several experiments to explore the component and the element “MSWord_FormatTableCell” needs a bookmark, that is, it only serves for static tables defined in the Word template. This issue is still pending resolution on my side. 

2021-07-29 06-38-13
Robert Roersch

@Stuart Harris any update form you side as developer of this component?

2021-07-29 06-38-13
Robert Roersch

Can someone provide a solution for this issue?
We still have the requirement open to use this color setting.

2025-08-07 06-30-56
Amit J
Champion

Workarounds 

Use a Word Template with Bookmarks

Create your table layout in a .docx template.

Add bookmarks for the cells where you want formatting.

Use MSWord_InsertTable and MSWord_FormatTableCell to apply colors to specific cells via bookmarks.

Limitations: Requires upfront template design, and dynamic columns make it more complex.

2021-07-29 06-38-13
Robert Roersch

Have considered that, but the document is now generated based on content in our OutSystems app. Using a template means a total redo of the actions to use a template and then still limitations in the required functionality.
This MSWordUtils component has the option to set the color, but it just does not work. A last, small but crucial part to complete in a flow that works fine for the rest.

2025-08-07 06-30-56
Amit J
Champion

It would be great if you can share the sample oml with your use case. It will help to troubleshoot the issue quickly and then  definitely will get solution.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.