When is the XDocument initialized? - InfoPath Dev
in

InfoPath Dev

When is the XDocument initialized?

Last post 01-08-2009 10:54 PM by Anuma. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 12-22-2008 03:30 PM

    • hsiva
    • Not Ranked
    • Joined on 12-22-2008
    • Posts 3

    When is the XDocument initialized?

    Hi ,

    I am working on an upgrade project from Infopath 2003 to 2007. In IP 2003 code there is a method called _startup which seems to be initializing XDocument and Application. But no such method is found in the IP 2007 converted project. My code accesses these objects and I get a null exception because XDocument is null. I was wondering if we have to specifically initialize Application (or Xdocument) to access it later?

    Also, it looks like there are two application classes , one in Microsoft.Office.Interop.InfoPath and one in Microsoft.Office.InfoPath. WHats the difference between those?

     

  • 12-22-2008 08:59 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: When is the XDocument initialized?

    Hi,

    "Microsoft.Office.Interop.InfoPath" is a infopath2003 assembly. and "Microsoft.Office.InfoPath" is a infopath2007 assembly.

    If you want to work with infopath2003 assembly, add “microsoft.office.interop.infopath.semitrust.dll” assembly to your references. This assembly file is located in “C:\Program Files\Microsoft Office\Office12” folder.  

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 12-29-2008 11:58 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: When is the XDocument initialized?

    Hello,

    Go through the below link to get more information on Xdocument,

    http://msdn.microsoft.com/en-us/library/bb229879.aspx

  • 12-30-2008 12:51 AM In reply to

    Re: When is the XDocument initialized?

    Hi,

    In IP 2007 we use XPathNavigator to access the nodes.

    In IP 2007, there is a method called InternalStartup(). In this method, write the following code.

    XPathNavigator XDocument = this.MainDataSource.CreateNavigator();

    Swathip
    www.ggktech.com
  • 01-08-2009 03:10 PM In reply to

    • hsiva
    • Not Ranked
    • Joined on 12-22-2008
    • Posts 3

    Re: When is the XDocument initialized?

    Thanks for the replies! After a little research I found that in the Infopath 2007 object model the XDocument class was renamed to the XmlForm class.

    http://msdn.microsoft.com/en-us/library/bb643160.aspx

    I will have to access Me.Application.XmlForm.Item(0) to get a reference to XDocument (in 2003 version)

  • 01-08-2009 10:54 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: When is the XDocument initialized?

    Thanks for posting this link to help others!

    Anuma Chinthapalli /
    http://www.GGKTech.com
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.