locked
Reading the Custom Properties of Office Documents RRS feed

  • Question

  • Hi All,

    I need to read the Custom Properties of Word Documents (2003,2007 & 2010) using .Net Code. I have to read the properties with out using Office DLLS. Is there are any ways ? Kindly suggest me the ideas.

    Thanks in Advance.


    Cheers! Maruthu | Software Developer | MCTS-SharePoint 2010 Application Development
    Thursday, November 17, 2011 9:09 AM

Answers

  • For documents saved in *.docx or *.docm format this should not be too difficult. These files are actually zip files containing folders, which in turn contain XML files. If your code extracts the zip file, it should find a folder named docProps, and one of the files in that folder may be custom.xml (this exists only if the document actually contains custom properties). When the code opens custom.xml, it can read the values from the XML nodes.

    It's harder to get properties out of Word 2003 (and earlier) *.doc files. Microsoft offers dsofile.dll, which you can download at http://support.microsoft.com/kb/224351. I don't know whether you consider this to be an "Office DLL" or not.


    Jay Freedman
    MS Word MVP  FAQ: http://word.mvps.org
    • Marked as answer by Maruthachalam Monday, November 21, 2011 5:24 AM
    Sunday, November 20, 2011 4:36 PM
  • Hi Jay

    Thanks for the reply.

    I was able to extract the properties of the 2007 and 2010 formats of word documents using Open XML SDK 2.0 for Microsoft Office which can downloaded from this link http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5124. This DLL is useful in reading the properties of the documents.

    Also, it is easy to get the properties of the Office 2003 documents using the DSO dll.

    Please refer the below article for reading the properties of 2010 word document using Open Office XML SDK 2.0

    http://sharepoint-works.blogspot.com/2012/01/reading-custom-properties-of-ms-office.html

     Happy Sharing!


    Cheers! Maruthu | Software Developer | MCTS-SharePoint 2010 Application Development

    Monday, November 21, 2011 5:27 AM

All replies

  • Hi,

     

    Thank you for using Microsoft Office for IT Professionals Forums.

     

    From your description, you can directly post your question on Word for Developers Forum below for further support:

     

    http://social.msdn.microsoft.com/Forums/en-US/worddev/threads

     

    Thanks for your understanding.

     

     

    Sincerely

    Rex Zhang

    --------------------------------------------------------------------------------

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Saturday, November 19, 2011 1:12 AM
  • For documents saved in *.docx or *.docm format this should not be too difficult. These files are actually zip files containing folders, which in turn contain XML files. If your code extracts the zip file, it should find a folder named docProps, and one of the files in that folder may be custom.xml (this exists only if the document actually contains custom properties). When the code opens custom.xml, it can read the values from the XML nodes.

    It's harder to get properties out of Word 2003 (and earlier) *.doc files. Microsoft offers dsofile.dll, which you can download at http://support.microsoft.com/kb/224351. I don't know whether you consider this to be an "Office DLL" or not.


    Jay Freedman
    MS Word MVP  FAQ: http://word.mvps.org
    • Marked as answer by Maruthachalam Monday, November 21, 2011 5:24 AM
    Sunday, November 20, 2011 4:36 PM
  • Hi Jay

    Thanks for the reply.

    I was able to extract the properties of the 2007 and 2010 formats of word documents using Open XML SDK 2.0 for Microsoft Office which can downloaded from this link http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5124. This DLL is useful in reading the properties of the documents.

    Also, it is easy to get the properties of the Office 2003 documents using the DSO dll.

    Please refer the below article for reading the properties of 2010 word document using Open Office XML SDK 2.0

    http://sharepoint-works.blogspot.com/2012/01/reading-custom-properties-of-ms-office.html

     Happy Sharing!


    Cheers! Maruthu | Software Developer | MCTS-SharePoint 2010 Application Development

    Monday, November 21, 2011 5:27 AM