Sorry if this is so simple of a question, but for the life of me I can't figure out how to do something.
I have a cell in a table in Word that I want to programmatically enter text in. Inside of that text I need a Content Control. So the text will look like this:
mytable.Cell(1,).Range.Text = What <color> is **this**?
Where <color>
equals the content control and "this" is bold. Obviously the .Text
property doesn't work here, but I can't figure out how to insert this string with a content control and formatting on the word "this".
Any advice?
I usually use a step-by-step approach...
As for the content control, it depends on what you mean. If you just need to insert a control with the Title or Tag "color", the above would be enough. But if you have controls connected to a custom XML data store, then you would need to use .XmlMapping.SetMapping to set its Xpath to point to the correct item in the store.