Closing Infopath via OnSaveRequest

N

Noel

Hi,

I would to know if its possible to close the Infopath program when the user
clicked the save button. I already tick the "Save using custom code" under
Form Option, and write the script below.

Sub XDocument_OnSaveRequest(eventObj)

' Write the code to be run before saving here.
eventObj.IsCancelled = eventObj.PerformSaveOperation

' Write the code to be run after saving here.
eventObj.ReturnStatus = True
Application.ActiveWindow.Close(true)

End Sub

After doing all above, I can't still close the infopath program after
clicking the save button.

Any comment please.

Thanks in advance!
 
N

Noel

Noel said:
Hi,

I would to know if its possible to close the Infopath program when the user
clicked the save button. I already tick the "Save using custom code" under
Form Option, and write the script below.

Sub XDocument_OnSaveRequest(eventObj)

' Write the code to be run before saving here.
eventObj.IsCancelled = eventObj.PerformSaveOperation

' Write the code to be run after saving here.
eventObj.ReturnStatus = True
Application.ActiveWindow.Close(true)

End Sub

After doing all above, I can't still close the infopath program after
clicking the save button.

Any comment please.

Thanks in advance!

any help please. thx!
 

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