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

Free Support Forum - aspose.com

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 http://www.aspose.com/documentation/java-components/aspose.words-for-java/com/aspose/words/documentproperty.htmlhttp://www.aspose.com/documentation/java-components/aspose.words-for-java/com/aspose/words/documentproperty.html

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 **** 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"?>
http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">

6705412A47686F91E5B3F5957AD04B812B71A64B990031ABEA615D896A23B70284FDB5B01C161EF8358E681CCBE1686293C1F7996A709BCEEA7001B7397C70489384180260D736479148122C3EC12EFE8E722C56222A22B1

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

6705412A47686F91E5B3F5957AD04B812B71A64B990031ABEA615D896A23B70284FDB5B01C161EF8358E681CCBE1686293C1F7996A709BCEEA7001B7397C70489384180260D736479148122C3EC12EFE8E722C56222A22B1

<!–[if gte mso 10]> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0pt 5.4pt 0pt 5.4pt; mso-para-margin:0pt; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:SimSun; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:Arial; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

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,