Good day. Need help!
How to close form infopath correctly?
I have same problem as author (i call web service, show message to user, than close infopath and receive exception)
I close infopath like this:
thisApplication.ActiveWindow.Close(true)
And exception follows:
Value cannot be null.
Parameter name: key
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary'2Insert(TKey key, TValue value)
at System.Collections.Generic.Dictionary'2set_Item(TKey key, TValue value)
at Microsoft.Office.InfoPath.Internal.ObjectIdentityHash.Create[T](Object internalObject, CreateOMObject createOMObject)
at Microsoft.Office.InfoPath.Internal.WindowHost.Create(WindowObject window)
at Microsoft.Office.InfoPath.Internal.ApplicationHost.get_ActiveWindow()
at MyForm.FormCode.CloseForm()
I only found one page in google about this exception, http://sharepoint-infopath.blogspot.ru/2011/11/infopath.html
but it is not helpfull
Thankx!