I am trying to display the document properties using c#. I have tried the following code :
contentControl.Range.Text = (wordDoc.Application.ActiveDocument.CustomDocumentProperties as Office.DocumentProperties)[1].Name;
but this just gives me the text. I actually want to add the document property in a way similar to the one which looks like when we add a document property manually. (by clicking on Insert=>quick parts=>Document property=>'Author').
Please check the image attached