Hi all,
I have a 2007 form which has been working. It is quite a complex form with lots of fields and conditional formatting. Almost all of the features have been achieved using rules. There is one button on the form which calls code. The code is in VB. This is the only routine in the form.
Public Sub PRINTFORM_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
Print(True)
End Sub
The code compiles with no errors. This button has been working correctly. But now it does not work, I get exception errors.
System.ArgumentException
Value does not fall within the expected range.
at Microsoft.Office.Interop.InfoPath.SemiTrust.ICLRExtensions.PrintWithDialog()
at Microsoft.Office.Interop.InfoPath.SemiTrust.ICLRExtensionsWrapper.PrintWithDialog()
at Microsoft.Office.InfoPath.Internal.XmlFormHost.Print(Boolean showPrintDialog)
at Microsoft.Office.InfoPath.XmlFormHostItem.Print(Boolean showPrintDialog)
at JSAWPv01._02.FormCode.PRINTFORM_Clicked(Object sender, ClickedEventArgs e)
at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
I have deleted the code and re written the line and I get the same error. I have created a brand new empty form and put one button on with the same code and it works fine. (I have other forms where this same print button works ok).
What is this error trying to tell me ? Where should I be looking ? Any help would be VERY welcome.
Thank you
Catharine