0
Answer

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

shoeb sayyed

shoeb sayyed

12y
889
1
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