First off, thanks for a great site!! I've been lurking and gleaning info for quite some time.
I an using the included code to make a new Outlook message appear. The reason I am doing it this way instead of with a data connection is because the person completing the form will need to edit the resulting email before it's sent. The Email code works fine for 1 part of the submission process except the attachment name. At a later stage, however, I need to get this email to be sent with no attachment at all.
so the 2 questions are...
1) Is there any way to change the attachment name from "Form1.xml" to something dynamic based on form fields using the code I've included (or some other coding)?
2) Is there any way to get the same new, pre-filled email message to open except with no attachment at all?
thanks in advance,
Craig
Function msoxd_my_editable_OnAfterChange(eventObj)
' If the submit operation is successful, set
' eventObj.ReturnStatus = True
'Opens an email window with prefilled subject line and with form as xml attachment (no HTML version).
On Error Resume Next
Set oTo = XDocument.DOM.selectSingleNode("//my:myFields/my:StoredValues/my:MailSettings/my:to")
Set oCC = XDocument.DOM.selectSingleNode("//my:myFields/my:StoredValues/my:MailSettings/my:cc")
Set oBCC = XDocument.DOM.selectSingleNode("//my:myFields/my:StoredValues/my:MailSettings/my:bcc")
Set oSubject = XDocument.DOM.selectSingleNode("//my:myFields/my:StoredValues/my:MailSettings/my:subject")
Set oBody = XDocument.DOM.selectSingleNode("//my:myFields/my:StoredValues/my:MailSettings/my:body")
formTo = oTo.text
formCC = oCC.text
formBCC = oBCC.text
formSubj = oSubject.text
formBody = oBody.text
XDocument.UI.ShowMailItem formTo, formCC, formBCC, formSubj, formBody
eventObj.ReturnStatus = False
Exit Function
End Function