#1   Report Post  
Andy Tallent
 
Posts: n/a
Default SendMail Question

Hi,

I am using the following code to attached a spreadsheet to an outlook message.

Application.Dialogs(xlDialogSendMail).Show _
arg1:=Sheets("Sheet1").Range("A1"), _
arg2:=Sheets("Sheet1").Range("A2")

I am able to specify a e-mail address with arg1 and subject with arg2 but
does anybody know if it is possible to specify some content for the body of
the e-mail message?

Thanks

--
Andy Tallent
  #2   Report Post  
galimi
 
Posts: n/a
Default

Andy,

I find it much more convenient to make a reference to the Outlook Library
and send mail messages that way. There are methods to include messages in
the body of the email.
--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"Andy Tallent" wrote:

Hi,

I am using the following code to attached a spreadsheet to an outlook message.

Application.Dialogs(xlDialogSendMail).Show _
arg1:=Sheets("Sheet1").Range("A1"), _
arg2:=Sheets("Sheet1").Range("A2")

I am able to specify a e-mail address with arg1 and subject with arg2 but
does anybody know if it is possible to specify some content for the body of
the e-mail message?

Thanks

--
Andy Tallent

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

The only other argument seems to be return receipt, so it looks like no.

If you have Outlook, you could build an email via automation which can
handle this. There is an example here
http://www.xldynamic.com/source/xld.EarlyLate.html

--
HTH

Bob Phillips

"Andy Tallent" wrote in message
...
Hi,

I am using the following code to attached a spreadsheet to an outlook

message.

Application.Dialogs(xlDialogSendMail).Show _
arg1:=Sheets("Sheet1").Range("A1"), _
arg2:=Sheets("Sheet1").Range("A2")

I am able to specify a e-mail address with arg1 and subject with arg2 but
does anybody know if it is possible to specify some content for the body

of
the e-mail message?

Thanks

--
Andy Tallent



  #4   Report Post  
Andy Tallent
 
Posts: n/a
Default

Hi Bob,

Thanks for this guidance. Perhaps I need to approach this in a different
way. I've tried also using some code from Ron de Bruins site (i think) which
does everything I want except that it automatically sends the mail and I
don't want this to happen. I want the e-mail message to be displayed as per
"Application.Dialogs(xlDialogSendMail).Show" so that the user can intervene
and add more text to the body. Is this possible at all using his code?

Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Sheets("Sheet1").Range("A1")
.CC = ""
.BCC = ""
.Subject = Sheets("Sheet1").Range("A2")
.Body = Sheets("Sheet1").Range("A3")
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing


Application.Quit


--
Andy Tallent


"Bob Phillips" wrote:

The only other argument seems to be return receipt, so it looks like no.

If you have Outlook, you could build an email via automation which can
handle this. There is an example here
http://www.xldynamic.com/source/xld.EarlyLate.html

--
HTH

Bob Phillips

"Andy Tallent" wrote in message
...
Hi,

I am using the following code to attached a spreadsheet to an outlook

message.

Application.Dialogs(xlDialogSendMail).Show _
arg1:=Sheets("Sheet1").Range("A1"), _
arg2:=Sheets("Sheet1").Range("A2")

I am able to specify a e-mail address with arg1 and subject with arg2 but
does anybody know if it is possible to specify some content for the body

of
the e-mail message?

Thanks

--
Andy Tallent




  #5   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Use display instead of Send

You can see that in all my examples
.Send 'or use .Display

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Andy Tallent" wrote in message ...
Hi Bob,

Thanks for this guidance. Perhaps I need to approach this in a different
way. I've tried also using some code from Ron de Bruins site (i think) which
does everything I want except that it automatically sends the mail and I
don't want this to happen. I want the e-mail message to be displayed as per
"Application.Dialogs(xlDialogSendMail).Show" so that the user can intervene
and add more text to the body. Is this possible at all using his code?

Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Sheets("Sheet1").Range("A1")
.CC = ""
.BCC = ""
.Subject = Sheets("Sheet1").Range("A2")
.Body = Sheets("Sheet1").Range("A3")
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing


Application.Quit


--
Andy Tallent


"Bob Phillips" wrote:

The only other argument seems to be return receipt, so it looks like no.

If you have Outlook, you could build an email via automation which can
handle this. There is an example here
http://www.xldynamic.com/source/xld.EarlyLate.html

--
HTH

Bob Phillips

"Andy Tallent" wrote in message
...
Hi,

I am using the following code to attached a spreadsheet to an outlook

message.

Application.Dialogs(xlDialogSendMail).Show _
arg1:=Sheets("Sheet1").Range("A1"), _
arg2:=Sheets("Sheet1").Range("A2")

I am able to specify a e-mail address with arg1 and subject with arg2 but
does anybody know if it is possible to specify some content for the body

of
the e-mail message?

Thanks

--
Andy Tallent








  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

Andy,

Then just change .Send to ,Display and it will open up but not send.

--
HTH

Bob Phillips

"Andy Tallent" wrote in message
...
Hi Bob,

Thanks for this guidance. Perhaps I need to approach this in a different
way. I've tried also using some code from Ron de Bruins site (i think)

which
does everything I want except that it automatically sends the mail and I
don't want this to happen. I want the e-mail message to be displayed as

per
"Application.Dialogs(xlDialogSendMail).Show" so that the user can

intervene
and add more text to the body. Is this possible at all using his code?

Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Sheets("Sheet1").Range("A1")
.CC = ""
.BCC = ""
.Subject = Sheets("Sheet1").Range("A2")
.Body = Sheets("Sheet1").Range("A3")
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing


Application.Quit


--
Andy Tallent


"Bob Phillips" wrote:

The only other argument seems to be return receipt, so it looks like no.

If you have Outlook, you could build an email via automation which can
handle this. There is an example here
http://www.xldynamic.com/source/xld.EarlyLate.html

--
HTH

Bob Phillips

"Andy Tallent" wrote in message
...
Hi,

I am using the following code to attached a spreadsheet to an outlook

message.

Application.Dialogs(xlDialogSendMail).Show _
arg1:=Sheets("Sheet1").Range("A1"), _
arg2:=Sheets("Sheet1").Range("A2")

I am able to specify a e-mail address with arg1 and subject with arg2

but
does anybody know if it is possible to specify some content for the

body
of
the e-mail message?

Thanks

--
Andy Tallent






  #7   Report Post  
Andy Tallent
 
Posts: n/a
Default

Hi Ron,

Thank you very much, this works perfectly. I feel a bit sheepish as it was
so simple....
--
Andy Tallent


"Ron de Bruin" wrote:

Use display instead of Send

You can see that in all my examples
.Send 'or use .Display

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Andy Tallent" wrote in message ...
Hi Bob,

Thanks for this guidance. Perhaps I need to approach this in a different
way. I've tried also using some code from Ron de Bruins site (i think) which
does everything I want except that it automatically sends the mail and I
don't want this to happen. I want the e-mail message to be displayed as per
"Application.Dialogs(xlDialogSendMail).Show" so that the user can intervene
and add more text to the body. Is this possible at all using his code?

Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Sheets("Sheet1").Range("A1")
.CC = ""
.BCC = ""
.Subject = Sheets("Sheet1").Range("A2")
.Body = Sheets("Sheet1").Range("A3")
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing


Application.Quit


--
Andy Tallent


"Bob Phillips" wrote:

The only other argument seems to be return receipt, so it looks like no.

If you have Outlook, you could build an email via automation which can
handle this. There is an example here
http://www.xldynamic.com/source/xld.EarlyLate.html

--
HTH

Bob Phillips

"Andy Tallent" wrote in message
...
Hi,

I am using the following code to attached a spreadsheet to an outlook
message.

Application.Dialogs(xlDialogSendMail).Show _
arg1:=Sheets("Sheet1").Range("A1"), _
arg2:=Sheets("Sheet1").Range("A2")

I am able to specify a e-mail address with arg1 and subject with arg2 but
does anybody know if it is possible to specify some content for the body
of
the e-mail message?

Thanks

--
Andy Tallent






  #8   Report Post  
Ron de Bruin
 
Posts: n/a
Default

If you want to add more text see also
http://www.rondebruin.nl/mail/tips2.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Andy Tallent" wrote in message ...
Hi Ron,

Thank you very much, this works perfectly. I feel a bit sheepish as it was
so simple....
--
Andy Tallent


"Ron de Bruin" wrote:

Use display instead of Send

You can see that in all my examples
.Send 'or use .Display

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Andy Tallent" wrote in message
...
Hi Bob,

Thanks for this guidance. Perhaps I need to approach this in a different
way. I've tried also using some code from Ron de Bruins site (i think) which
does everything I want except that it automatically sends the mail and I
don't want this to happen. I want the e-mail message to be displayed as per
"Application.Dialogs(xlDialogSendMail).Show" so that the user can intervene
and add more text to the body. Is this possible at all using his code?

Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Sheets("Sheet1").Range("A1")
.CC = ""
.BCC = ""
.Subject = Sheets("Sheet1").Range("A2")
.Body = Sheets("Sheet1").Range("A3")
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing


Application.Quit


--
Andy Tallent


"Bob Phillips" wrote:

The only other argument seems to be return receipt, so it looks like no.

If you have Outlook, you could build an email via automation which can
handle this. There is an example here
http://www.xldynamic.com/source/xld.EarlyLate.html

--
HTH

Bob Phillips

"Andy Tallent" wrote in message
...
Hi,

I am using the following code to attached a spreadsheet to an outlook
message.

Application.Dialogs(xlDialogSendMail).Show _
arg1:=Sheets("Sheet1").Range("A1"), _
arg2:=Sheets("Sheet1").Range("A2")

I am able to specify a e-mail address with arg1 and subject with arg2 but
does anybody know if it is possible to specify some content for the body
of
the e-mail message?

Thanks

--
Andy Tallent








  #9   Report Post  
Andy Tallent
 
Posts: n/a
Default

Thank you Bob,

Kind Regards
--
Andy Tallent


"Bob Phillips" wrote:

Andy,

Then just change .Send to ,Display and it will open up but not send.

--
HTH

Bob Phillips

"Andy Tallent" wrote in message
...
Hi Bob,

Thanks for this guidance. Perhaps I need to approach this in a different
way. I've tried also using some code from Ron de Bruins site (i think)

which
does everything I want except that it automatically sends the mail and I
don't want this to happen. I want the e-mail message to be displayed as

per
"Application.Dialogs(xlDialogSendMail).Show" so that the user can

intervene
and add more text to the body. Is this possible at all using his code?

Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Sheets("Sheet1").Range("A1")
.CC = ""
.BCC = ""
.Subject = Sheets("Sheet1").Range("A2")
.Body = Sheets("Sheet1").Range("A3")
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing


Application.Quit


--
Andy Tallent


"Bob Phillips" wrote:

The only other argument seems to be return receipt, so it looks like no.

If you have Outlook, you could build an email via automation which can
handle this. There is an example here
http://www.xldynamic.com/source/xld.EarlyLate.html

--
HTH

Bob Phillips

"Andy Tallent" wrote in message
...
Hi,

I am using the following code to attached a spreadsheet to an outlook
message.

Application.Dialogs(xlDialogSendMail).Show _
arg1:=Sheets("Sheet1").Range("A1"), _
arg2:=Sheets("Sheet1").Range("A2")

I am able to specify a e-mail address with arg1 and subject with arg2

but
does anybody know if it is possible to specify some content for the

body
of
the e-mail message?

Thanks

--
Andy Tallent






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM
formula question Pam Coleman Excel Worksheet Functions 9 April 11th 05 08:51 AM
Question about combining data from multiple workbooks into one rep BookOpenandUpright Excel Discussion (Misc queries) 2 February 19th 05 12:37 PM
An easy macro question and one I believe to be a little more diffi TroutKing Excel Worksheet Functions 3 January 18th 05 09:17 PM
test for date in column question Buster Excel Worksheet Functions 1 December 10th 04 04:38 AM


All times are GMT +1. The time now is 10:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"