Custom properties added to a document through Aspose should be visible In the Document Information panel for .DOC format Files

Hi,

I am trying to save some custom properties into word/excel documents. I have already successfully done the addition with .docx format files using



doc.CustomDocumentProperties.Add(“ContentTypeId”, contentTypeValue);



for the content type and



CustomXmlPart myXml1 = new CustomXmlPart();

byte[] b1 = Encoding.UTF8.GetBytes(xmlString);

myXml1.Data = b1;

doc.CustomXmlParts.Add(myXml1);



for content type’s fields(custom properties).



This works as intended, I can see the newly added fields in the Document information Panel and all is good.



But the issue starts with the .doc format.



Since .doc does not follow xml based structure, the custom properties are all added using

//Content Type

doc.CustomDocumentProperties.Add(“ContentTypeId”, contentTypeValue);

//Content Type Fields

doc.CustomDocumentProperties.Add(customPropertyName, customPropertyValue);



I can see that the properties are added, and I can right click the file and check the custom tab for the properties but none of these properties show up in the document information panel. This would work if I open the document with office 2003 but any other version shows no sign of properties from within the document( hence no way to modify them).



I have attached images showing the issue along with sample documents of how it should be and what I get using aspose.



Please have a look and let me know if I can solve the issue in some other way or is this a undesired behavior that would be fixed.



With best regards,

Shahzad Naseem

Hi Shahzad,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. It seems that your query is related to MS Word. Could you please share some more detail about your query what exact you want to achieve using Aspose.Words?

It would be great if you please share following detail for investigation purposes.

  • Please

    create a standalone/runnable simple application (for example a Console
    Application Project
    ) that demonstrates the code (Aspose.Words code) you used to generate
    your output document

  • Please manually create your expected Word
    document using Microsoft Word 2010/2013 and attach it here for our
    reference. We will investigate how you want your final Word output be
    generated like.
  • Please share the screenshot of MS Word 2003 showing the 'Document information Panel’

As soon as you get these pieces of information to
us we’ll start our investigation into your issue.

Hi,

Thank you for replying. I must say Aspose.Words is a brilliant solution when it comes to operations on word documents. For the sake of .docx format documents, everything is working exactly as I required. The issue is just with .doc format. Following are the requested documents and samples for your reference.



I am going to attach a sample project along with this post which will add custom properties into a newly created .doc file.



Here is a step by step guide to recreate the issue.



1. Create a new .doc file through any MS word and run it through the sample project. Output from the project will be a file with custom properties attached to it. To verify if the custom properties were added, you can right click the file and go to properties-custom and be able to see the newly added properties.



2. Then open the out put file with Word 2007/2010/2013. Click File and open then properties and show document panel.



3. This panel will not contain any of the custom properties added. This should contain those properties as MS word supports it( refer to “HowItShouldBeLike.doc” attached )



As for Word 2003. these properties are viewable already via file-properties-custom from within the document. Please refer to the image attached along with this post.

Hi Shahzad,

Thanks for sharing the detail. The custom properties which are added to document using CustomDocumentProperties.Add method do not visible in Document Information Panel.

Using MS Word 2013, you can add some custom properties by clicking Advanced Properties in the upper left of the Document Information Panel, but the properties will not appear in the Document Information Panel.

Please check the following link.
https://support.office.com/en-au/article/Add-property-information-to-a-document-db294c79-e112-44a3-aff8-a61229a5bb6b

With the reference of above link, custom properties to the Document Information Panel if you are using a property management server, such as Microsoft Office SharePoint Server 2007, and Office InfoPath 2007.

Could you please share the steps how you added the custom properties in Document Information Panel as shown in HowItShouldBeLike.doc?

Shahzad.Naseem:

CustomXmlPart myXml1 = new CustomXmlPart();
byte[] b1 = Encoding.UTF8.GetBytes(xmlString);
myXml1.Data = b1;
doc.CustomXmlParts.Add(myXml1);

for content type’s fields(custom properties).

This works as intended, I can see the newly added fields in the Document information Panel and all is good.

Could you please share the document (Docx) generated via Aspose.Words which shows the custom properties in Document information Panel along with code example here for testing purposes? I will investigate the issue and provide you more information.

Hi,



I added the custom properties while saving the document into a SharePoint server. It asks for content type while saving and then if the document library has any custom columns(fields) it will ask the user to fill those fields and open the Document Information Panel. when the user fills it and saves it, the document then on will always show those custom fields in the Document Information panel for both docx and doc files.



I have also attached the working docx that was the output of the attached project as requested.

I hope this helps fix the issue.



with best regards,

Shahzad Naseem

Hi Shahzad,

Thanks for sharing the
detail. I have tested the scenario and have found that the custom property ‘0x01011’ is shown in Document Information Panel for Doc file format but the fields values are not visible. Please check the attached image and document. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-11287. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.