Open form w/out opening Infopath?

K

Kim

Is there anyway to open the form and keep it in the Sharepoint site instead
of the Infopath application opening in a separate window?

Thanks!
 
L

Lenore Benefield

Kim,

It would help if I understood the reason you would like to do this.

If the reason is that you want to protect the form from respondents changing
it, you can go to the Tools Menu-> Form Options - General Tab and select
Enable Protection. You can add to that by using the Open and Save Tab and
deselecting whatever action you want to restrict.

Lenore
 
K

Kim

Thanks Lenore for your response.

We want our users to stay in the Sharepoint Portal without having another
application (InfoPath) open when a form is filled out. However, if that
option is not available, I've heard that InfoPath can close automatically
when the form is submitted, which would take the user back to the Portal
site. I am unfamilar on how to do this as well.
 
L

Lenore Benefield

Kim,

You will need to add a Button control to your template.
Set the Action to Submit and enable submit commands and buttons
Submit to SharePoint Form Library
Choose Submit Options
Choose Close the form.

Good luck!
Lenore
 
K

Kim

Great. That worked for closing the form, but is there a way to completely
close Infopath?

Thanks,

Kim
 
L

Lenore Benefield

Personally, I would add a custom success message. Thank you for submitting
your information, you can now close InfoPath. Thank you.
 
S

Scott L. Heim [MSFT]

Hi Kim,

If you don't mind writing a little code, you can accomplish what you need:

- Right-click on your button and choose Properties
- Click Edit Form Code - you should see code similar to the following:

Sub CTRL5_7_OnClick(eventObj)
'Write your code here
End Sub

- Replace the line "Write your code here" with the following:

XDocument.Submit
Application.ActiveWindow.Close true

- Save and test

** NOTE: The above code is VBScript - if you are using JScript, change
those lines to the following:

XDocument.Submit();
Application.ActiveWindow.Close(true);

One last item - if you want to display a message to the user before closing
InfoPath, add the following between the 2 lines noted above:

- VBScript:
XDocument.UI.Alert "InfoPath will now close!"

- JScript:
XDocument.UI.Alert("InfoPath will now close!");

I hope this helps!

Take care,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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