As I indicated in my first reply, the code you posted had nothing to do with adding a DOCPROPERTY field to a document. I also showed the correct syntax to add a DOCPROPERTY field to a document.
The process for adding a DOCVARIABLE field to a document is the same as for adding a DOCPROPERTY field to a document; simply change DOCPROPERTY to DOCVARIABLE. However, that still doesn't add the DOCVARIABLE to the document! neither does it update one. DOCVARIABLE and DOCPROPERTY fields can do no more than reflect what is in the document properties and variables to which they refer.
For more on Document Variables, see:
Document.Variables property (Word) | Microsoft Docs
For more on Custom Document Properties, see:
Document.CustomDocumentProperties property (Word) | Microsoft Docs
Quote:
I would like to update my profile for Hdata. Please show me.
|
You do that via the UserCP link at the top of this page. See:
https://www.msofficeforums.com/usercp.php