joeyjackson:Also when you say to move the rules to the form close event, how does one do that
If you have not created those rules, what I incur is yr case from your question, then you have nothing to move.
joeyjackson:How does one to this?
When I add "this.save()" to the ClickedEventArgs of my button it tells me that "this" is not declared. I'm missing something.
First, it is not "
this.save()" but
"this.Save();" and it is in C# (note capital "S" and ";" at the end)
You should use
IntelliSense in
VSTA Second, it is not argument but call of a method to be placed in the body of event handling method.
I would again insist again your manual copy-pasting but instead generating the VSTA code by GUI using
3d. if you have not changed your Programming Language then it will be Visual Basic.NET and you should have written "Me.Save()"
4th, it is, obviously, available only in Infopath Filler forms
Though, I cannot manage to succeed with this in Infopath 2010 getting:
InfoPath cannot save the form.
The form does not have a file name.
at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocument.Save()
at Microsoft.Office.Interop.InfoPath.SemiTrust.XDocumentWrapper.Save()
at Microsoft.Office.InfoPath.Internal.XmlFormHost.Save()
at Microsoft.Office.InfoPath.XmlFormHostItem.Save()
at CS_client.FormCode.CTRL1_5_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)