Edit

Share via


SolutionObject Interface

Definition

Corresponds to an InfoPath form template.

public interface class SolutionObject : Microsoft::Office::Interop::InfoPath::SemiTrust::Solution
[System.Runtime.InteropServices.Guid("096cd557-0786-11d1-95fa-0080c78ee3bb")]
public interface SolutionObject : Microsoft.Office.Interop.InfoPath.SemiTrust.Solution
type SolutionObject = interface
    interface Solution
Public Interface SolutionObject
Implements Solution
Attributes
Implements

Examples

In the following example, a reference is set to the Solution object, then the code gets the name of the person who authored the form from the .xsf using the DOM property of the Solution object. A test is then made to determine if there is an author value, and the results are displayed in a message box.

[InfoPathEventHandler(MatchPath="SolutionInfo", EventType=InfoPathEventType.OnClick)]
public void SolutionInfo_OnClick(DocActionEvent e)
{
<span class="label">Solution</span> solution = thisXDocument.<span class="label">Solution</span>;
 string solutionVersion = solution.Version;
 string authorText;
 IXMLDOMNode author = solution.DOM.selectSingleNode("xsf:xDocumentClass/@author");

 if (author != null)
 {
  authorText = author.text;
 }
 else
 {
  authorText = "Author not available.";
 }

 thisXDocument.UI.Alert("Version: " + solutionVersion + "\nAuthor: " + authorText);
}

Remarks

This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, seeSolution.

Using the members of the Solution interface provides compatibility with InfoPath 2003. To use new members that were added to the Solution2 object model in InfoPath 2010, you must cast the object returned by the Solution property of the XDocument object to the Solution2 type. For more information, see How to: Use Object Model Members That Are Not Compatible with InfoPath 2003.

The SolutionObject object implements properties for getting information about a form template, including its version number, the Uniform Resource Locator (URL) of its extracted form files, the URL it was loaded from, and an XML Document Object Model (DOM) containing its form definition (.xsf) file.

The SolutionObject object is accessed through the Solution property of the XDocument object.

Properties

DOM

Gets a reference to an XML Document Object Model (DOM) that contains the source XML of the form definition (.xsf) file.

(Inherited from Solution)
PackageURL

Gets the Uniform Resource Locator (URL) of the cache folder that contains a Microsoft Office InfoPath 2003 form's extracted form files.

(Inherited from Solution)
URI

Gets the Uniform Resource Identifier (URI) of a Microsoft Office InfoPath 2003 form template.

(Inherited from Solution)
Version

Gets the version number of a form template.

(Inherited from Solution)

Applies to