E
educos
Hi,
When I run this piece of code from a Windows Form program, I get an invalid
cast exception when I try to access the Errors property of XDocument
interface...
Why ?
ApplicationClass app = new ApplicationClass();
XdDocumentVersionMode mode = XdDocumentVersionMode.xdCanOpenInReadOnlyMode;
int numMode = (int)mode; // =8
XDocument form = app.XDocuments.Open(@"MyForm.xml", numMode); // ==> ok, I
can see the form opened in Infopath
ErrorsCollection ec = form.Errors; // ==> "Invalid cast exception" !!!!
int countErrors = ec.Count;
app.Quit(false);
What I want to do is to open a set of infopath forms and verify that all
forms are valid .
When I run this piece of code from a Windows Form program, I get an invalid
cast exception when I try to access the Errors property of XDocument
interface...
Why ?
ApplicationClass app = new ApplicationClass();
XdDocumentVersionMode mode = XdDocumentVersionMode.xdCanOpenInReadOnlyMode;
int numMode = (int)mode; // =8
XDocument form = app.XDocuments.Open(@"MyForm.xml", numMode); // ==> ok, I
can see the form opened in Infopath
ErrorsCollection ec = form.Errors; // ==> "Invalid cast exception" !!!!
int countErrors = ec.Count;
app.Quit(false);
What I want to do is to open a set of infopath forms and verify that all
forms are valid .