Hi Qwer,
You'll want to use XDocument.Solution.DOM and query it for xsf:xDocumentClass. Then you can get @name which "provides a unique, Uniform Resource Name (URN)–based name for the form that the .xsf file defines." This is all documented in the SDK which is a great read. If you haven't looked at it, please install the InfoPath SDK and have fun!
function SolutionInfo::OnClick(eventObj)
{
var objSolution = XDocument.Solution;
var strSolutionVersion = objSolution.Version;
var objNameNode = objSolution.DOM
.selectSingleNode("xsf:xDocumentClass/@name");
var strNameText;
if (objNameNode != null)
strNameText = objNameNode.text;
else
strNameText = "Name not available.";
XDocument.UI.Alert("Version: " + strSolutionVersion +
"\nName: " + strNameText);
}
Patrick Halstead [InfoPath MVP]
InfoPathDev
Patrick Halstead
Project Manager at Qdabra