How can I get Object Names from InfoPath Template with VS/VB.NET - InfoPath Dev
in

InfoPath Dev

How can I get Object Names from InfoPath Template with VS/VB.NET

Last post 11-12-2008 05:35 AM by Beebo. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-11-2008 10:33 AM

    • Beebo
    • Not Ranked
    • Joined on 11-11-2008
    • Posts 6

    How can I get Object Names from InfoPath Template with VS/VB.NET

    Greetings...

    I have this client who would like to move a mountain of Excel based "forms" (really just workbooks with row-by-row data) to InfoPath.  I am no InfoPath wizard by any stretch, but I do work in Visual Studio 2005 and write most code in VB.NET.  I have set up a VB.NET app for them that allows them to select a spreadsheet, and then the specific sheet that has their data.  I then list the column headings in the selected sheet in a listbox.  Now here's the part where I am somewhat baffled...

    I want to allow them to pick an already-designed InfoPath template (.XSN) and then allow them to "map" the Excel columns to the InfoPath Object names.  So to do this, I need a way to query the XSN and get a list of Object names.  (Most, if not all will be textboxes - no fancy stuff at this point).  I loaded the Interop lib for InfoPath to see if I could use that to get at this data, but as yet, cant figure out a way to get those names. 

    Any of you InfoPath Gurus know how I might do this quick and easy?

    Note - (with respect) please do not suggest using the InfoPath "Import Form" option - they tried this and it just gave them endless repeating tables.  That is not what they are after at all.  They want a single form for each row of data in the Excel Workbook.

    Thanks very much in advance!!

     

     

     

     

     

     

  • 11-11-2008 03:33 PM In reply to

    Re: How can I get Object Names from InfoPath Template with VS/VB.NET

    An XSN file is simply a CAB file with XML, XSD, and XSL files in it.  If you use a CAB library to crack it open, you can inspect the schema and provide a list of the node names in it.

     If you are going to be doing this with a lot of XSN files, may I direct your attention to Qdabra's InfoPath to XML Tool? It does typically require setting up the mapping manually, but it was designed for this purpose and might save you a bit of hassle.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-12-2008 05:35 AM In reply to

    • Beebo
    • Not Ranked
    • Joined on 11-11-2008
    • Posts 6

    Re: How can I get Object Names from InfoPath Template with VS/VB.NET

    Jimmy,

    Thank you so much for the reply, and for the information.  That said, I am stunned to hear what you are telling me!  An XSN is just a CAB file?  Really?  I will look into the CAB Library today and start investigating that path.  I never would have suspected that!  As well, thanks for the tip on Qdabra's tool - I will also look into that. 

    Thanks again, so very much, for the help!

    Regards,

    Beebo

     

     

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.