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 / Word / Programming / July 2005

Tip: Looking for answers? Try searching our database.

Can you include a recipient using activeDocument.SendMail VB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tinytall - 08 Jul 2005 14:58 GMT
I found a way to send a document via email from within the document, creating
a button with the activedocument.sendmail function. However, I can't seem to
find a way to add a specified recipient, or change the subject line. It does
open the email with the document attached, but I want to force a TO:
recipient, and change the subject line.

http://support.microsoft.com/default.aspx?scid=kb;en-us;209248

I have found a similar code set that does allow me to accomplish adding a
TO: recipient, and change the subject, but it is using Routing Slips, which
also does not actually open the email, rather creates the email, adds the
document, changes the subject, puts in the TO: recipient, and sends it,
giving the sender no options.

Private Sub CommandButton1_Click()
ActiveDocument.HasRoutingSlip = True
With ActiveDocument.RoutingSlip
   .Subject = "Customer Survey"
   .AddRecipient "etallberg@nedocs.com"
   '.AddRecipient "Secondaddress@Mail.com"
   .Delivery = wdAllAtOnce
End With
ActiveDocument.Route

End Sub

I'd like to combine the two functions taking the result of the first one,
and adding the recipient and change the subject and allow the user to send at
their discretion.

Thanks
Doug Robbins - 08 Jul 2005 17:54 GMT
See the article "How to send an email from Word using VBA" at:

http://word.mvps.org/FAQs/InterDev/SendMail.htm

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I found a way to send a document via email from within the document,
>creating
[quoted text clipped - 32 lines]
>
> Thanks
Tinytall - 08 Jul 2005 18:01 GMT
That's where I got the second option with the Routing Slip, but it isn't what
I want it to do. I need it to open the email, attach the activeDocument and
insert a specified email address, and change the subject line. The Routing
slip example in that link doesn't show how this is done.

Thanks

Eric

> See the article "How to send an email from Word using VBA" at:
>
[quoted text clipped - 36 lines]
> >
> > Thanks
Jean-Guy Marcil - 08 Jul 2005 19:17 GMT
Tinytall was telling us:
Tinytall nous racontait que :

> That's where I got the second option with the Routing Slip, but it
> isn't what I want it to do. I need it to open the email, attach the
> activeDocument and insert a specified email address, and change the
> subject line. The Routing slip example in that link doesn't show how
> this is done.

What email client are you using?

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Tinytall - 08 Jul 2005 19:24 GMT
Outlook, but if at all possible, a non-specific email client script is best.
What I have provided in the original posting is scripted into the Word
Document providing a routing slip email to be generated via Outlook. I doubt
that will work in a Lotus environment.

My goal is to have a Word document be filled in, and provide a "Submit Now"
button that packages the document as an attachment to an email, provide the
email address for it to be sent, and the subject line to be specific. I'm
very surprised that there isn't anything out there like this already.

Thanks

Eric

> Tinytall was telling us:
> Tinytall nous racontait que :
[quoted text clipped - 6 lines]
>
> What email client are you using?
Jean-Guy Marcil - 08 Jul 2005 20:51 GMT
Tinytall was telling us:
Tinytall nous racontait que :

> Outlook, but if at all possible, a non-specific email client script
> is best. What I have provided in the original posting is scripted
> into the Word Document providing a routing slip email to be generated
> via Outlook. I doubt that will work in a Lotus environment.

If you want to be non-specific, you have to use the RoutingSlip method, as
described in the web site you first went to.

> My goal is to have a Word document be filled in, and provide a
> "Submit Now" button that packages the document as an attachment to an
> email, provide the email address for it to be sent, and the subject
> line to be specific. I'm very surprised that there isn't anything out
> there like this already.

The RoutingSlip method does exactly that, I do not understand why you do not
want to use it.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Tinytall - 08 Jul 2005 21:00 GMT
The email simply is created, and it is sent. I want the email tool (Outlook
or otherwise), to remain open and allow the user to hit the Send button. This
method simply sends the email directly.

This works for me for the most part. I was hoping to get the email to be
created with the address already there, but not actually send it. I'll deal
with this.

Thanks

Eric

> Tinytall was telling us:
> Tinytall nous racontait que :
[quoted text clipped - 15 lines]
> The RoutingSlip method does exactly that, I do not understand why you do not
> want to use it.
Helmut Weber - 08 Jul 2005 21:06 GMT
Hi,

there is a line somewhere in your code.
.send

Use it, if you want to send.

If you want to show the mail and leave the decision to the user,

replace ".send" by ".display".

Works with both Outlook and Notes.

Greetings from Bavaria, Germany

Helmut Weber, MVP, WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
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.