ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Add comments into email body using VBA (https://www.excelbanter.com/excel-discussion-misc-queries/66730-add-comments-into-email-body-using-vba.html)

Noemi

Add comments into email body using VBA
 
Hi

I have an excel form which is emailed by users once a cmd button on the form
is click.

Is there anyway to code in a message in the main body of the email as you
can attach the document, enter in to the TO and the Subject field.

If it is possible is there a way that once the cmd button is clicked that a
message box appears requesting to have comments entered and once completed
and OK clicked then the email is sent with the comments in the main body that
was entered into the message box.

If I can please have how to do both scenarios that would be great as I need
to use both if possible.

Thanks
Noemi

Dave Patrick

Add comments into email body using VBA
 
Give this a go.

http://www.paulsadowski.com/WSH/cdo.htm

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Noemi" wrote:
| Hi
|
| I have an excel form which is emailed by users once a cmd button on the
form
| is click.
|
| Is there anyway to code in a message in the main body of the email as you
| can attach the document, enter in to the TO and the Subject field.
|
| If it is possible is there a way that once the cmd button is clicked that
a
| message box appears requesting to have comments entered and once completed
| and OK clicked then the email is sent with the comments in the main body
that
| was entered into the message box.
|
| If I can please have how to do both scenarios that would be great as I
need
| to use both if possible.
|
| Thanks
| Noemi



Noemi

Add comments into email body using VBA
 
Hi Dave
I tried and it did not work. We have excel 2000 - Windows XP but we receive
the following error message and are not sure why or how to fix.

runtime error -2147220960 (80040220) The "SendUsing" configuration is invalid.

any help would be greatly appreciated.

Are you aware of anyother way.

Thanks
Noemi

"Dave Patrick" wrote:

Give this a go.

http://www.paulsadowski.com/WSH/cdo.htm

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Noemi" wrote:
| Hi
|
| I have an excel form which is emailed by users once a cmd button on the
form
| is click.
|
| Is there anyway to code in a message in the main body of the email as you
| can attach the document, enter in to the TO and the Subject field.
|
| If it is possible is there a way that once the cmd button is clicked that
a
| message box appears requesting to have comments entered and once completed
| and OK clicked then the email is sent with the comments in the main body
that
| was entered into the message box.
|
| If I can please have how to do both scenarios that would be great as I
need
| to use both if possible.
|
| Thanks
| Noemi




Dave Patrick

Add comments into email body using VBA
 
Sounds like you tried using CDONTS.NewMail

I think you must use CDO.Message with Windows XP

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Noemi" wrote:
| Hi Dave
| I tried and it did not work. We have excel 2000 - Windows XP but we
receive
| the following error message and are not sure why or how to fix.
|
| runtime error -2147220960 (80040220) The "SendUsing" configuration is
invalid.
|
| any help would be greatly appreciated.
|
| Are you aware of anyother way.
|
| Thanks
| Noemi



Noemi

Add comments into email body using VBA
 
Hi Dave
I used CDO.Message and I got the error.
I haven't tried using CDONTs.newmail

I think I will just forget the main body of the email and use the subject box.

Thanks for your help.

Noemi

"Dave Patrick" wrote:

Sounds like you tried using CDONTS.NewMail

I think you must use CDO.Message with Windows XP

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Noemi" wrote:
| Hi Dave
| I tried and it did not work. We have excel 2000 - Windows XP but we
receive
| the following error message and are not sure why or how to fix.
|
| runtime error -2147220960 (80040220) The "SendUsing" configuration is
invalid.
|
| any help would be greatly appreciated.
|
| Are you aware of anyother way.
|
| Thanks
| Noemi




Dave Patrick

Add comments into email body using VBA
 
You need to fill in the smtp server name in your code. These may help.

How do I send e-mail with CDO?
http://www.aspfaq.com/show.asp?id=2026

Sending mail from Excel with CDO
http://www.rondebruin.nl/cdo.htm


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Noemi" wrote:
| Hi Dave
| I used CDO.Message and I got the error.
| I haven't tried using CDONTs.newmail
|
| I think I will just forget the main body of the email and use the subject
box.
|
| Thanks for your help.
|
| Noemi




All times are GMT +1. The time now is 11:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com