Hello,
I'm using Infopath 2003 to design a form that will be submitted to a SharePoint after filled out. The Data Connection sets the name of the form, based on the name of two fields.
I need the user to have the option of sending an email with the form attached and appearing in the body of the message. To do this, I tried the code:
var objEmail = XDocument.DataAdapters("SubmitEmail");
objEmail.Submit();
Using this, the attachment received the correct name was not displayed in the message body.
Then I tried:
objEmail = Application.ActiveWindow.MailEnvelope;
Using this, the attachment was displayed in the body of the message, but the attachment name was not set (stayed on Form1.xml).
The only way I’ve found to work around was to create user roles to a New and a Submitted form. The Email button is displayed only in the submitted role that I set as default.
So, the user has to submit the form and reopen it via SharePoint. This way, the form name will be ok and I can have the correct attachment name to use with MailEnvelope.
Is there a simple way to do this?
How could I set the form name after submitting it?
Thanks