Edit infopath XML without opening Infopath

J

Jason Bailey

Hello,
I'm using the following code:

Dim myApp As Application = _
New Microsoft.Office.Interop.InfoPath.Application


Dim myXDoc As XDocument = myApp.XDocuments.New( _
"D:/blnakallinfo.xml", _
XdDocumentVersionMode.xdFailOnVersionOlder)

Is there an alternative to this that would work in the same way as:
Dim myXmlDocument As XmlDocument = New XmlDocument
myXmlDocument.Load("D:/test.xml")

i.e. Load an infopath xml file but not within infopath?

Thanks
Jason
 
V

virgul

Hi,

I don't know with your code but if you remove the PI in the xml that don't
open with infopath

And you can make better if you take your view1.xsl (default name) out of
infopath project(xsn with winzip for example) and you add this under the PI

<?xml-stylesheet type="text/xsl" href="view1.xsl"?>

and if the infopath is not installed on the machine that load automatically
with the xsl (only the vision is correct the validation and all this things
work not)!!!

Good luck

Thierry

"Jason Bailey" a écrit :
 
J

Jason Bailey

virgul said:
Hi,

I don't know with your code but if you remove the PI in the xml that don't
open with infopath

And you can make better if you take your view1.xsl (default name) out of
infopath project(xsn with winzip for example) and you add this under the PI
Good luck

Thierry

Hi and thanks. I still want the form available to Infopath users. I just
want to have to some code create an infopath form based on other XML data
(XML data captured by PHP web form). The idea is automate the creation of
infopath xml forms which are then used by people afterwards. I've sort of got
round it by using myapp.quit but I just assumed that I'd be able to open an
Infopath XML file in the same way as a standard XML file.

Jason
 
V

virgul

So the only things you need is that the xml is valid for the XMLschema in
infopath and you have to add the PI in the xml (every xsn has a different PI)

So create a xml with your xsn (fill the form send in your e-mail for example)

open this xml copy the second line of your infopath xml and add it to the
xml that you wan't to open with infopath!!!

good luck

Thierry
 

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