We're sorry Aspose doesn't work properply without JavaScript enabled.

# About Class DocumentProperty for docx

Hi, Sir,

It works when I use Class DocumentProperty for DOC with your sample code,

But fail for docx.

Can you give me an example code for DOCX, just you do for doc in https://reference.aspose.com/words/java/com.aspose.words/DocumentProperty

and email me to : linjl@magtech.com.cn

Thank you
LIN jiale
Beijing Magtech

Hello

Thanks for your request. Could you please attach the document you are getting problem with? I will investigate the problem on my side and provide you more information.

Best regards,

Hi, sir,
I need to add and change the value of <vt:lpwstr>****</vt:lpwstr> in the custom.xml, with ASPOSE.WORD.

LIN Jiale
Beijing Magtech

11-448_editing/docProps/custom.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
</property>
</Properties><?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
</property>
</Properties>


Hi

Thanks for your request. the following code will return all custom document properties:

Document doc = new Document(@"Test001\in.docx");
foreach (DocumentProperty property in doc.CustomDocumentProperties)
{
Console.WriteLine("{0} = {1}", property.Name, property.Value);
}


In your case, there is only one custom document property – “uploadURL”. To change its value, you can use code like the following:

Document doc = new Document(@"Test001\in.docx");
doc.CustomDocumentProperties["uploadURL"].Value = "This is new value of the property";
doc.Save(@"Test001\out.docx");


Best regards,