COM Exception

J

Joel Palmer

Anybody know why I would get a com exception when a required field is left
blank rather than a friendly user validation warning? When I enter valid
data, no exception.
System.Runtime.InteropServices.COMException

I am catching the exception now and giving the user a generic "All fields
with a red * are required". Not the best solution :)

==============

thisXDocument.Submit();

theMail.SendMail("(e-mail address removed)","<a href="+FormURL+">Click
Here to View the form</a>","New Employee Notifications","New Employee
Notification: "+TheName+"");

thisXDocument.UI.Alert("Notification has been sent.");

thisApplication.ActiveWindow.Close(false);


========================

Thanks,
Joel
 
J

Joel Palmer

Here is the full:
System.Runtime.InteropServices.COMException
InfoPath cannot submit the form.
The form cannot be submitted because it contains validation errors. Errors
are marked with either a red asterisk (required fields) or a red, dashed
border (invalid values).
at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocument.Submit()
at Microsoft.Office.Interop.InfoPath.SemiTrust.XDocumentWrapper.Submit()
at Microsoft.Office.Interop.InfoPath.SemiTrust.XDocumentWrapper.Submit()
at NEN.NEN.GenerateTicketsButton_OnClick(DocActionEvent e) in
c:\documents and settings\joelp\my documents\visual studio
projects\nen\formcode.cs:line 131
at
Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent
pEvent)
 

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