For some time now, I have been on the hunt for a solution to allow InfoPath 2003 users to submit the current view (not the default view) of a form via email (Outlook) without it sending as an attachment. From what I am learning, there is a certain script or code that I can apply to the submit button (command) that will send the current view of the form in the body of the email. I really don't know a thing about VB Script besides basic Excel stuff. The code that others have posted is great and all, but I need to go back a step or two to actually walk through the steps of where to post the script or code. And if I need to change it to fit my application at all.
I have enabled Microsoft Visual Studio Tools for Application (MVSTA) in InfoPath (I am working in InfoPath 2007).
In design mode/view, when I click on "Edit Form Code" in Button Properties window of the submit button, it opens MVSTA and notes "Write your code here." under the "Public Sub FormEvents_Submit(ByVal sender As Object, ByVal e As SubmitEventArgs)" section. Is this where I would type in (or paste) the code?
In addition to learning where to post the script, I need the specific script information that will make this work. Preferably, I would like to copy what someone gives me and paste it in whatever area it goes and then close the window. If there is anything else needed, I need specific instructions of what to alter or further customize.
If it helps, here is my application:
My company has not transitioned everyone to MS Office 2007 yet, which means even though I build 2003 forms using InfoPath 2007, the users will be submitting the forms via 2003. The forms that I'm creating have different views because each view is sent to a different group of people. I can adjust the Email Submit data connection settings to "Send only the active view of the form and no attachment," but that results in a blank email sent from 2003 users. The moment I change the setting so that 2003 users can submit it as an attachment, they lose the ability to send the current view (meaning the view that is sent/attached is the default view of the form). I have a couple of different forms and different applications, and my problem stems from needing to be able to have 2003 users submit a form that captures the current view and sends it in the body of the email instead of as an attachment.
In a perfect world, I would tell everyone to catch up and update their programs to Office 2007! Only I haven't the ability or authority to do so. I'm so close, and everything else in InfoPath has been within my reach (having little technical experience), but I need help going the rest of the way. I know it's possible.
Thanks in advance for any help or assistance!