Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hints And Tips For New Posters In The Excel Newsgroups | Excel Worksheet Functions | |||
formula question | Excel Worksheet Functions | |||
Question about combining data from multiple workbooks into one rep | Excel Discussion (Misc queries) | |||
An easy macro question and one I believe to be a little more diffi | Excel Worksheet Functions | |||
test for date in column question | Excel Worksheet Functions |