NewFromSolutionWithData parameters

M

MattM

According to the documentation on MSDN this method is defined as:

NewFromSolutionWithData(ByVal varXMLData As Variant, ByVal varSolutionURI As
Variant, [ByVal dwBehavior As Long = 1]) As XDocument

and here's the details on the first parameter:

varXMLData Required Variant. Provides the XML data to be used as a
template for the form. Can be a string that specifies the Uniform Resource
Identifier (URI) of an XML document, or an XMLDOMNode that contains the XML
to be used as the XML document (template).

I'm not sure what the possible values are for the first parameter. I
understand it can point to an XML document via URI but the XMLDOMNode is
unfamilar. I've tried to search for the definition of this object but the
closest quote I can find is that:

"The DOMDocument object itself is an XMLDOMNode object".

Can someone explain exactly what is an XMLDOMNode or what this first
parameter can be? The closest match I've found is the return value of
documentElement method for the DOMDocument50 object
(DOMDocument50.documentElement). I'd like to know all the possible objects
and not just guess.
 
M

MattBell

You are on the right path,
What I did for my solution was to create an object of type
"MSXML2.DOMDocument.3.0"

Then I loaded my xml string into it (ie XmlDoc.LoadXml(stringVar) )
then on my call to infopath I pass it the root element of the dom object,
and the url of the infopath form I'm opening.

NewFromSolution(XmlDoc.documentElement,form_url)

The one thing I have noticed is that if something fails, it's hard to
determine what exactly. And it fails all together. But I have done this
successfully.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top