Forum


Replies: 1   Views: 32
Replacevariablebyhtml keeping word styles

Posted by andrewk1983  · 17-04-2025 - 06:21

Hi all,

Using latest Word create blank document and set its font size to 9 (usual default is 11 or something). Add some static text and then a bookmark, which will be replaced with the following HTML content:

<p>Some text<br /><br />Some more text</p><p>Some text</p><p>&nbsp;</p><p>Some more text</p>
Save the file run script to replace abovementioned bookmark. The font size for the replaced bookmark changes to 12. Also <p> tags aren't being treated with new lines (although a paragraph should behave like a paragraph, right?).
 
What am I doing wrong here? Any help is appreciated!