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,
Thank for your reply,
I need to add and change the value of <vt:lpwstr>****</vt:lpwstr> in the custom.xml, with ASPOSE.WORD.
Please give me an example?

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 fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="2" name="uploadURL">
<vt:lpwstr>6705412A47686F91E5B3F5957AD04B812B71A64B990031ABEA615D896A23B70284FDB5B01C161EF8358E681CCBE1686293C1F7996A709BCEEA7001B7397C70489384180260D736479148122C3EC12EFE8E722C56222A22B1</vt:lpwstr>
</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 fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="2" name="uploadURL">
<vt:lpwstr>6705412A47686F91E5B3F5957AD04B812B71A64B990031ABEA615D896A23B70284FDB5B01C161EF8358E681CCBE1686293C1F7996A709BCEEA7001B7397C70489384180260D736479148122C3EC12EFE8E722C56222A22B1</vt:lpwstr>
</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,