NewFromSolution / NewFromSolutionWithData

F

FondaUK

Hi all,

I have an MS Access database where information entered needs to be
exported into an InfoPath form stored on a SharePoint server.

Users click on a button within the database and the current record is
exported to an XML file with the associated schema file - first line
below.

My problem occurs when trying to use the NewFromSolutionWithData
command. The form does not open and I have an error message of

Infopath cannot create a new blank form
The selected file is an update of a form on your computer. However the
update has been blocked because the autjor of the file cannot be
verified


Yet, I get the above error message when I create the form from scratch
and publish it only once.

When I use NewFromSolution, the form opens fine but I cannot import the
data with an error message of

The form has an unknown structure. The XML Schema specified for the
form could not be identified.

Yet the schema was created in the first line below!

Application.ExportXML acExportTable, "tblXML", strPathName &
strXMLFileName, strPathName & strXMLLayout
Set appInfoPath = CreateObject("InfoPath.Application")
Set objInfoPathXDoc =
appInfoPath.XDocuments.NewFromSolutionWithData(strPathName &
strXMLFileName, strManifest)
Set objInfoPathXDoc =
appInfoPath.XDocuments.NewFromSolution(strPathName & "Resource.xsn")
objInfoPathXDoc.ImportFile (strPathName & strXMLFileName)
objInfoPathXDoc.SaveAs strPathName & strXMLFileName


I think it has something to do with extracting the form files, ie
manifest.xsf, but even when doing this, I get the first error message
above.

Any ideas?

Many Thanks

Graham
 

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