how to display Document Property in a word document (the way it is displayed when done manually) using c#?

Jun 27 2012 1:14 AM
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