Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2006

Tip: Looking for answers? Try searching our database.

Send e-mail with jscript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott - 27 Mar 2006 18:00 GMT
I am using:

{var oEnvelope = application.activewindow.mailenvelope;
oEnvelope.visible = true;}

to send my form via e-mail.  The problem is, it is being sent as an
attatchment and in the body of the e-mail.  Is there a way to only send the
form as an attatchment and keep the body of the e-mail empty?  Thanks.
S.Y.M. Wong-A-Ton - 27 Mar 2006 18:19 GMT
Have you already tried using an EmailAdapter instead of a MailEnvelope?

You could create an email submit data connection via InfoPath's user
interface, then retrieve it in code and use it as an EmailAdapter to submit
your form. The EmailAdapter object offers more flexibility/possibilities than
the MailEnvelope. See
http://msdn.microsoft.com/library/en-us/ipsdk/html/xdobjEmailAdapterObject_HV011
06499.asp?frame=true

---
S.Y.M. Wong-A-Ton

> I am using:
>
[quoted text clipped - 4 lines]
> attatchment and in the body of the e-mail.  Is there a way to only send the
> form as an attatchment and keep the body of the e-mail empty?  Thanks.
Scott - 27 Mar 2006 20:01 GMT
Is this a jscript code or vb script?  is there a way to use jscript and
vbscript on the same form?

> Have you already tried using an EmailAdapter instead of a MailEnvelope?
>
[quoted text clipped - 14 lines]
> > attatchment and in the body of the e-mail.  Is there a way to only send the
> > form as an attatchment and keep the body of the e-mail empty?  Thanks.
Uma Karnati - 28 Mar 2006 07:01 GMT
The given code (Which is in the given link) will work in the VBScript and
Jscript. But, there is no way to use Jscript and Vbscript on the single
InfoPath form.
Signature

Uma Karnati
http://www.autonomysystems.com

> Is this a jscript code or vb script?  is there a way to use jscript and
> vbscript on the same form?
[quoted text clipped - 17 lines]
> > > attatchment and in the body of the e-mail.  Is there a way to only send the
> > > form as an attatchment and keep the body of the e-mail empty?  Thanks.
S.Y.M. Wong-A-Ton - 28 Mar 2006 07:34 GMT
It's jscript code. And no, you can use either jscript or vbscript in one form.
---
S.Y.M. Wong-A-Ton

> Is this a jscript code or vb script?  is there a way to use jscript and
> vbscript on the same form?
[quoted text clipped - 17 lines]
> > > attatchment and in the body of the e-mail.  Is there a way to only send the
> > > form as an attatchment and keep the body of the e-mail empty?  Thanks.
Sandeep - 28 Mar 2006 08:04 GMT
Hi Scott

To use this code, you will first have to add E-mail as a Submitting Data
Source.

1) In Design mode, choose Data Connections from the Tools Menu and then
click Add.
2) Select Submit Data, and then click Next.
3) Select as an e-mail message, and then click Next.
4) Delete all text in all textboxes on the window (you will be adding all of
this content back in later using code). Click Next.
5) On the next window enter a name into the textbox. Remember what you name
it. Click Finish.

U can write code as :

CTRL136_7::OnClick(eventObj)
- XDocument::OnLoad(eventObj)
- CTRL211_7::OnClick(eventObj)
- XDocument::OnSaveRequest(eventObj)
- XDocument::OnSign(eventObj)

Write this code in above functions any one.

var objEmailAdapter;
objEmailAdapter = XDocument.DataAdapters("THE NAME YOU TYPED IN STEP FIVE");
objEmailAdapter.To = "list@example.com";
objEmailAdapter.Subject = "Status Report";
objEmailAdapter.Submit();

Signature

Sandeep
www.autonomysystems.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.