none
programmatically read word document identify table of contents and associated data(Description. ,images, etc) RRS feed

  • Question


  • Hi,

    I have to programmatically read a word document and all of its contents within it get the table of contents and associated data/descriptions for the table of contents, which could also include images,tables etc.

    I was looking for a methodology by which execute this job. Request folks to suggest solutions around this.

    Regards,

    Ravi Shankar

    Wednesday, November 12, 2014 5:25 PM

Answers

  • Hi Ravi Shankar,

    Based on the description, you want to read the contents for Word document. If you haven't install the Word application, I also suggest that you use Open XML SDK. You can get more samples manipulating document form link below:
    Word processing (Open XML SDK)

    If you installed the Word application and we can automate Word application to achieve the goal. Here is a sample to read the text from first cell of first table from Word document for your reference:

    Sub ReadFirstCell()
    Debug.Print ActiveDocument.Tables(1).Rows(1).Cells(1).Range.Text
    End Sub
    Here is link for the Word object model for your reference:
    Object model reference (Word 2013 developer reference)

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 25, 2014 8:53 AM
    Moderator

All replies

  • Hello,

      If you only want read .docx file, you can use openxml sdk.

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

     if the reply help you mark it as your answer.
     Free No OLE C# PowerPoint, Word ExcelPDF  Component(Create, Modify, Convert & Print) 

    Thursday, November 13, 2014 1:37 AM
  • Hi Ravi Shankar,

    Based on the description, you want to read the contents for Word document. If you haven't install the Word application, I also suggest that you use Open XML SDK. You can get more samples manipulating document form link below:
    Word processing (Open XML SDK)

    If you installed the Word application and we can automate Word application to achieve the goal. Here is a sample to read the text from first cell of first table from Word document for your reference:

    Sub ReadFirstCell()
    Debug.Print ActiveDocument.Tables(1).Rows(1).Cells(1).Range.Text
    End Sub
    Here is link for the Word object model for your reference:
    Object model reference (Word 2013 developer reference)

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 25, 2014 8:53 AM
    Moderator