R
Rob Whittaker
I use InfoPath 2007 and I have seen many posts about the actual code needed
to close InfoPath after a form has been submitted but I am lost as to how to
actually know where the code should go step by step.
I want to close Infopath after submitting my form, i guess the following
code is correct
"XDocument.View.Window.Close(true)"
Where do I put this exactly? I right click on the submit button in my form,
select button properties and get the button properties dialog box. Under the
general tab with Action selected with "rules and custom code" , I click on
"Edit form code" (above "rules") and Microsoft Visual Studio Tools for
Applications open with a lot of pre written code.
See below
Imports Microsoft.Office.InfoPath
Imports System
Imports System.Windows.Forms
Imports System.Xml
Imports System.Xml.XPath
Imports mshtml
Namespace Template1
Public Class FormCode
' Member variables are not supported in browser-enabled forms.
' Instead, write and read these values from the FormState
' dictionary using code such as the following:
'
' Private Property _memberVariable() As Object
' Get
' _memberVariable = FormState("_memberVariable")
' End Get
' Set
' FormState("_memberVariable") = value
' End Set
' End Property
' NOTE: The following procedure is required by Microsoft Office
InfoPath.
' It can be modified using Microsoft Office InfoPath.
Private Sub InternalStartup(ByVal sender As Object, ByVal e As
EventArgs) Handles Me.Startup
AddHandler EventManager.XmlEvents("/my:myFields").Changing,
AddressOf myFields_Changing
AddHandler DirectCast(EventManager.ControlEvents("CTRL1_5"),
ButtonEvent).Clicked, AddressOf CTRL1_5_Clicked
End Sub
Public Sub myFields_Changing(ByVal sender As Object, ByVal e As
XmlChangingEventArgs)
' Ensure that the constraint you are enforcing is compatible
' with the default value you set for this XML node.
' Write your code here.
End Sub
Public Sub CTRL1_5_Clicked(ByVal sender As Object, ByVal e As
ClickedEventArgs)
' Write your code here.
End Sub
End Class
End Namespace
Where do I go from here I don't know??? Any help appreciated.
to close InfoPath after a form has been submitted but I am lost as to how to
actually know where the code should go step by step.
I want to close Infopath after submitting my form, i guess the following
code is correct
"XDocument.View.Window.Close(true)"
Where do I put this exactly? I right click on the submit button in my form,
select button properties and get the button properties dialog box. Under the
general tab with Action selected with "rules and custom code" , I click on
"Edit form code" (above "rules") and Microsoft Visual Studio Tools for
Applications open with a lot of pre written code.
See below
Imports Microsoft.Office.InfoPath
Imports System
Imports System.Windows.Forms
Imports System.Xml
Imports System.Xml.XPath
Imports mshtml
Namespace Template1
Public Class FormCode
' Member variables are not supported in browser-enabled forms.
' Instead, write and read these values from the FormState
' dictionary using code such as the following:
'
' Private Property _memberVariable() As Object
' Get
' _memberVariable = FormState("_memberVariable")
' End Get
' Set
' FormState("_memberVariable") = value
' End Set
' End Property
' NOTE: The following procedure is required by Microsoft Office
InfoPath.
' It can be modified using Microsoft Office InfoPath.
Private Sub InternalStartup(ByVal sender As Object, ByVal e As
EventArgs) Handles Me.Startup
AddHandler EventManager.XmlEvents("/my:myFields").Changing,
AddressOf myFields_Changing
AddHandler DirectCast(EventManager.ControlEvents("CTRL1_5"),
ButtonEvent).Clicked, AddressOf CTRL1_5_Clicked
End Sub
Public Sub myFields_Changing(ByVal sender As Object, ByVal e As
XmlChangingEventArgs)
' Ensure that the constraint you are enforcing is compatible
' with the default value you set for this XML node.
' Write your code here.
End Sub
Public Sub CTRL1_5_Clicked(ByVal sender As Object, ByVal e As
ClickedEventArgs)
' Write your code here.
End Sub
End Class
End Namespace
Where do I go from here I don't know??? Any help appreciated.