Can you include a recipient using activeDocument.SendMail VB

T

Tinytall

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 "(e-mail address removed)"
'.AddRecipient "(e-mail address removed)"
.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
 
T

Tinytall

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
 
J

Jean-Guy Marcil

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?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
T

Tinytall

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
 
J

Jean-Guy Marcil

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.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
T

Tinytall

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
 
H

Helmut Weber

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"
 

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