Getting Error when Trying to Open Form Programmatically - InfoPath Dev
in

InfoPath Dev

Getting Error when Trying to Open Form Programmatically

Last post 10-15-2014 10:46 AM by Douglas. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-06-2008 08:38 AM

    • chrisf
    • Not Ranked
    • Joined on 11-06-2008
    • Posts 3

    Getting Error when Trying to Open Form Programmatically

    In the clicked event for a button in an InfoPath 2007 template, I have added code that is attempting to open an infopath form with this statement using C#:
    This.Application.Xdocuments.Open(tempFileName); Also tried, This.Application.XmlForms.Open(tempFileName);

    But I am getting this error:
    Microsoft.Office.Infopath.Application does not contain a definition for xdocuments.

    The following using statements are included:
    using Microsoft.Office.InfoPath;
    using System;
    using System.Xml;
    using System.Xml.XPath;
    using System.IO;
    using System.Text;

    What am I missing?

  • 11-06-2008 08:51 AM In reply to

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

    Re: Getting Error when Trying to Open Form Programmatically

    Hi,

     I have tried to open a form with below code in infopath2007 and it is worked for me.

    this.Application.XmlForms.Open(templatefilename);  

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 11-06-2008 03:38 PM In reply to

    Re: Getting Error when Trying to Open Form Programmatically

    this.Application.XmlForms.Open(filename) also works for me without adding any using statements.

    Application.Xdocuments doesn't exist in forms with the 2007 object model.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-15-2014 10:46 AM In reply to

    Re: Getting Error when Trying to Open Form Programmatically

     Try:

    using Microsoft.Office.InfoPath;
    using Microsoft.Office.Interop.InfoPath;
    using Microsoft.Office.Interop.InfoPath.Xml;
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.