I'm trying to create a word template with place holders (content controls), I then want to replace the text within these place holders using Open XML but I can't do it.
So within word I've entered Design Mode and added a Rich Text Box content control. Then using the properties I've set the Title/Tag to textBuildingName for example.
So I now want to change the text of that place holder from my C# code using Open XML. However I don't really know how to reference the place holder in code. So all I have so far is this:
using (WordprocessingDocument doc = WordprocessingDocument.Open(docPath, true))
{
//What do I do here to get the content control by name
//so I can do something like this:
//textBuildingName.Text="This is my replacement text from my application";
}
Any advice on this would be greatly received, I can't find any good tutorials on the web.
I'm using Visual Studio 2012 and Word 2013