SolutionObject interface

Corresponds to a Microsoft Office InfoPath form template.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
<GuidAttribute("096CD557-0786-11D1-95FA-0080C78EE3BB")> _
Public Interface SolutionObject _
    Inherits Solution
'Usage
Dim instance As SolutionObject
[GuidAttribute("096CD557-0786-11D1-95FA-0080C78EE3BB")]
public interface SolutionObject : Solution

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, seeSolution2.

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.

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.

public void SolutionInfo_OnClick(DocActionEvent e)
{
 Solution solution = thisXDocument.Solution;
 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);
}

See also

Reference

SolutionObject members

Microsoft.Office.Interop.InfoPath namespace