I need to create a text (2 lines, multiple fonts) programmatically, that I later place in several tables (<100) of my document.
The only way I found out to solve this, is to create a Word.Paragraph and copy its Range to the cells. The problem with this approach is: while creating a Paragraph, it’s added to the Document.
I want to create a formatted text like creating a string, all in the code without modifying the Document.
One approach I have used is to use HTML or richtext, which is essentially a string anyway. I am fairly sure Word can interpret either of these with the right com object settings.
Another approach I have tried is using the clipboard instead of a word object. You can do something like this:
(importing
system.windows.forms)