What is the best way to populate XML and MS-Word forms?

Last post 05-19-2008 3:41 AM by Samu Zhang - MSFT. 1 replies.

Sort Posts:

  • What is the best way to populate XML and MS-Word forms?

    05-15-2008, 9:29 AM
    • Loading...
    • smcirish
    • Joined on 04-16-2007, 9:27 PM
    • Texas
    • Posts 209

    Does anyone have a better way to work with XML and Word forms.  I have multiple Corporate forms that I will be populating including checkboxes.  Here's my method, if you have a better/easier way, please share:

    1. I save the Word form as XML
    2. I change the extension to XSL
    3. I wrap it with a DataSet tag and mark the locations within the xsl where the fields will go
    4. In the C# code I use the XML classes and export the XML to Word specifying to use the XSL

    This all works but is excruiatingly tedious.  If it were straight text, no problem.  But there are conditions on multiple checkboxes in the form that depend on the value passed from the dataset which means for each checkbox I have to do something similar to an if/else statement.  Not trying to be lazy but if there's a better way, I'll take it.

    Thanks in advance for any advice you experts can give.
    ~ Remember To Mark The Posts Which Helped You As The ANSWER ~
    Filed under: , , ,
  • Re: What is the best way to populate XML and MS-Word forms?

    05-19-2008, 3:41 AM
    Answer

    Hi smcirish ,

    I basically understand what you are doing. And I think this is one good way to do this .

    You can use Word Automate , but I do not like to use that, because I am not familar with that api.

    If you are using Office2007 , the thing will be simple. You can use OpenXmlSDK to manipulate MSWord easily.  

     

    Sincerely,
    Samu Zhang
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
Page 1 of 1 (2 items)