InfoPath throwing an exception while creating a new form

P

Pradeep Yamujala

Hi,

I have a infopath form to read/write data over webservice. In that i
have a task in which i have to create a new form from the form template. To
achive this i am using the follwoing code;
Application.XmlForms.NewFromFormTemplate(path);
here "path" will have OS path like
"C:\Users\Pradeep\Desktop\bulbul\LAForm.xsn". But this method is throwing an
excpetion. The exception details are as followos;
System.Runtime.InteropServices.COMException
The following URL, path, or file name is invalid:
"C:\Users\Pradeep\Desktop\bulbul\LAForm.xsn"

The file path referred to by an object model call must be absolute.

at
Microsoft.Office.Interop.InfoPath.SemiTrust.XDocumentsCollectionWrapper.NewFromSolution(Object varURI)
at
Microsoft.Office.InfoPath.Internal.XmlFormsHost.NewFromFormTemplate(String
formTemplateLocation)
at NAC.ASD.InfoPath.LAForm.FormCode.openForm(String formName) in
D:\Projects\NAC.ASD - NAC\NAC.ASD.InfoPath.LAForm\FormCode.cs:line 1040
at NAC.ASD.InfoPath.LAForm.FormCode.CTRL39_62_Clicked(Object sender,
ClickedEventArgs e) in D:\Projects\NAC.ASD -
NAC\NAC.ASD.InfoPath.LAForm\FormCode.cs:line 1062
at
Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)


Please help me to resolve this.

Thanks & Regards
Pradeep Yamujala
 

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