none
Extract Form Fields with OpenXML SDK RRS feed

  • Question

  • Hi,

    I am newbie in this forum and hope experts here can help me to get idea on my task.

    Actually, I have a word with some fillable form fields defined in word 2003, and I

    need to extract the form fields values with automation. Initially, I want to use

    VSTO to open a word doc and then do something on extract the form fields,

    and then I browse the web and found word 2007 can export into 2007 xml format

    and then use SDK to do processing on the content. Then I think can I open the

    word 2003 file in word 2007 and then save it as xml and then use SDK to

    extract the form fields?

    But in this form, I search "form field" and seems not many articles talking

    this topic. I would like to seek some suggestions from experts here?

    Can the SDK read the form field values as well as form field name from xml

    file? Is it easy or difficult? If possible, would you show me some examples

    (or some web pages) for this?

     

    Really thanks a lot,

    Raymond

    Tuesday, May 3, 2011 5:06 PM

Answers

All replies

  • Hi Raymond,

    Sorry for the late reply.

    If the xml file contains the information about the form field, I think it possible to read the xml information from the xml files via XML SDK not Open XML SDK. Open XML SDK is used to process docx files.

    So, could you show me the example of your xml file? I will do further research with the file information.

    Besides, why not save the word 2003 file as word 2007 or word 2010 file? It can contain the form fields and can be processed by Open XML SDK.

    I hope this can give you the hint.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 10, 2011 3:32 AM
  • Hi Bruce,

    Thanks for your reply first. Happy to see the help from you.

    Actually, my plan is to open an word 2003 doc in WORD 2007 and then save it

    as word 2007 format and then processed the 2007 file in open xml sdk.

    But as there is no much information (actually, I can't find any in the Internet) to

    do form field extraction from word 2007 with open xml sdk. In fact, I know

    the word 2007 format document is actually a zip structure files with many xml

    files embedded. But I really do not think I should go directly to the xml files

    and should use the open xml sdk to do it for me.

    Bruce, do you know any web which show some steps on using the sdk to read

    the form fields values and its field names?

    Any book published for this kind of purpose?

    Thanks for your help again.

    Raymond

    Wednesday, May 11, 2011 10:33 AM
  • Hi,

    Any response from experts?

    Thanks,

    Raymond

    Tuesday, May 24, 2011 3:23 PM
  • Hi Raymond,

    Here is a blog article about extract the information of content controls: http://blogs.msdn.com/b/ericwhite/archive/2008/08/21/using-linq-to-xml-to-retrieve-content-controls-in-word-2007.aspx , you can use this similar method to get the combobox and other controls.

    We can use the openxml productivity tool:http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c6e744e5-36e9-45f5-8d8c-331df206e0d0&displaylang=en to reflect the code and which can make it easy for us to code.

    Hope the suggestion can give you the hint.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Bruce Song Friday, May 27, 2011 10:12 AM
    • Marked as answer by Bruce Song Friday, June 3, 2011 12:28 PM
    Wednesday, May 25, 2011 3:43 AM