How to change the body of an email submit data connection

A

A.M

Hi,

How can I change the body of an email submit data connection ** at runtime
**

Thank you,
Alan
 
S

Scott L. Heim [MSFT]

Hi Alan,

You will need to change your "submit" functionality to use custom code and
then in the OnSubmitRequest event handler you can use code similar to the
following:

Dim objBodyText
Set objBodyText =
XDocument.DOM.selectSingleNode("//my:myFields/my:txtBodyText")

XDocument.UI.ShowMailItem "(e-mail address removed)", "", "", "Subject: Test",
objBodyText.text
eventObj.ReturnStatus = true

** NOTE: In this sample, I have a text box on my form and the data that is
in that text box is the text that appears in the body of the mail.

Keep in mind, this method will only send your form as an attachment not as
part of the body.

I hope this helps!

Scott L. Heim
Microsoft Developer Support

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

A.M

Thank you for reply.

But this doesn't use email adaper. Can I use email adapter and change the
email body text?

Alan
 
S

Scott L. Heim [MSFT]

Hi Alan,

TO my knowledge, no - you cannot dynamically change the body of the e-mail
adapter.

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