6
Views
5
Comments
Solved
[MSWordUtils] MSWord_PopulateTable - Remove Format
Forge component by Stuart Harris
5
Published on 15 Oct 2020
Application Type
Traditional Web

Hi All,

Im trying to use the "MSWord_PopulateTable" to populate tables that are user-defined, but the font is always Colibri-11.

Can I leave the user-defined table with the format that the user want?


Thanks

Best Regards


Champion
Rank: #152
Solution

Hi Filipe,


I have investigated and I can confirm that it is possible to make the table's formatting to apply to the inserted content.

In the example, the Arial font was applied just by changing the font of the content in the table.  This will not work.

You have to create a table style and apply it to the table, row or cell of the table.

First select the table.  Then navigate to the Table Design tab, right-click on one of the styles and select New Table Style.

Then the scope the style should apply to (I selected "Whole table"), and select the style settings.

Then select the area of the table to apply the style (if its a Whole table style, it will just apply to the whole table anyway).

These style settings will be maintained, while manually selected style settings will not, when content is inserted.

See attached document for an example.

I hope this makes sense and helps you get the formatting you need!

Kind regards,

Stuart


TableActions2.docx

Rank: #16088

Hi Stuart!

It's working perfectly!

Thanks for everything!!!

Filipe


Champion
Rank: #152

Hi Filipe,

Thank you for your question. 

Formatting tables in Microsoft Word can be tricky.  Would you mind uploading your template Word document? that will help me reproduce the problem.  Also a screenshot of your code would help.

Kind regards,

Stuart

Rank: #16088

Hi Stuart, 

Thanks in advance for your help.

You can use the code of the demo. The result is always the same, font Colibri 11.
The attached file (TableActions.docx)  is already formatted with Arial 9 and the bookmark "Actions".

Many Thanks

Filipe Lemos

TableActions.docx

Champion
Rank: #152

Thanks Filipe, I'll will have a look and get back to you in a few days.

Kind regards,

Stuart

Champion
Rank: #152
Solution

Hi Filipe,


I have investigated and I can confirm that it is possible to make the table's formatting to apply to the inserted content.

In the example, the Arial font was applied just by changing the font of the content in the table.  This will not work.

You have to create a table style and apply it to the table, row or cell of the table.

First select the table.  Then navigate to the Table Design tab, right-click on one of the styles and select New Table Style.

Then the scope the style should apply to (I selected "Whole table"), and select the style settings.

Then select the area of the table to apply the style (if its a Whole table style, it will just apply to the whole table anyway).

These style settings will be maintained, while manually selected style settings will not, when content is inserted.

See attached document for an example.

I hope this makes sense and helps you get the formatting you need!

Kind regards,

Stuart


TableActions2.docx

Rank: #16088

Hi Stuart!

It's working perfectly!

Thanks for everything!!!

Filipe