Send form as attachment via code or macro

D

Denise

I know very little VB code and was wondering if there was a way to write a code or macro to mail an excel form via outlook & prompt the to field with the "mailto" address (like a hyperlink)? I want to perform this function like a "click here" field rather than going through the manual process of File --> Send To --> Mail Recipient (as attachment). If there is a good website that also offers this information, please advise.
 
R

Ron de Bruin

Look here Denise
http://www.rondebruin.nl/sendmail.htm

Post back if you need help

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




I know very little VB code and was wondering if there was a way to write a code or macro to mail an excel form via outlook &
prompt the to field with the "mailto" address (like a hyperlink)? I want to perform this function like a "click here" field
rather than going through the manual process of File --> Send To --> Mail Recipient (as attachment). If there is a good website
that also offers this information, please advise.
 
D

Denise Posey

See post Jan 292004 4:52pm

Thank you for the reference to your website. Lots of good code to use. Maybe I'm missing this, but is there an example to stop once you get to Outlook and not automatically send? I want to stop in the body area so someone will be able to attach photos from their DcImages and then click the send button. Once they click send, they return back to the active Excel worksheet.

I looked through the codes and I'm sure that I'm missing it due to my little experience with VB.

Denise
 
R

Ron de Bruin

Hi Denise

Use Display instead of Send if you use Outlook code
.Send 'or use .Display


If you SendMail code leave the address empty

If you use this line you can choose a address in the address book or type one yourself.
And also you can type some text in the body.
.SendMail "", "This is the Subject line"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)




See post Jan 292004 4:52pm

Thank you for the reference to your website. Lots of good code to use. Maybe I'm missing this, but is there an example to stop
once you get to Outlook and not automatically send? I want to stop in the body area so someone will be able to attach photos
from their DcImages and then click the send button. Once they click send, they return back to the active Excel worksheet.

I looked through the codes and I'm sure that I'm missing it due to my little experience with VB.

Denise
 
D

David

Ron de Bruin wrote
If you SendMail code leave the address empty

If you use this line you can choose a address in the address book or
type one yourself. And also you can type some text in the body.
.SendMail "", "This is the Subject line"

I've been playing with this over the weekend and have the opposite need.

My code with altered recipient:

Sub Email()
On Error Resume Next
Sheets(1).Select
ActiveWorkbook.SendMail Recipients:="(e-mail address removed)"
End Sub

This creates the mail correctly, but just places it in my Outlook Outbox
without sending it :(
 
R

Ron de Bruin

Hi David

There is a setting that you can change but it can give a problem.
Read the note below from my website
**********************************

Because there is a bug in Outlook it is possible that you must uncheck
"send immediately when connect" in the Outlook options.
<Tools>Options>Mail Setup in the Outlook menu>

Problem :
It will not close the Outlook process after the mail is sent in the Task Manager
 
D

David

Ron de Bruin wrote
Hi David

There is a setting that you can change but it can give a problem.
Read the note below from my website
**********************************

Because there is a bug in Outlook it is possible that you must uncheck
"send immediately when connect" in the Outlook options.
<Tools>Options>Mail Setup in the Outlook menu>

Problem :
It will not close the Outlook process after the mail is sent in the
Task Manager

Err... that ain't good! Thanks for the info. I've looked at your site many
times, but I admit it was only at the code.
 

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