ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   excel programming (https://www.excelbanter.com/excel-programming/431680-excel-programming.html)

Pam M

excel programming
 
I have a macro that sends an automatic email from Excel to notify that a file
needs to be reviewed.

Application.Dialogs(xlDialogSendMail).Show _
arg2:="MIX REQUEST: " & [JobName] & ".xls", arg3:=True

This places the filename of the file that needs to be reviewed into the
subject. Because it is going straight from excel, it also attaches the file.
Which argument in DialogSendMail should be marked false so that the
attachment doesn't go and just the email does?

Ron de Bruin

excel programming
 
Hi Pam

You need other code to do this
Do you use Outlook ???



"Pam M" schreef in bericht
...
I have a macro that sends an automatic email from Excel to notify that a
file
needs to be reviewed.

Application.Dialogs(xlDialogSendMail).Show _
arg2:="MIX REQUEST: " & [JobName] & ".xls", arg3:=True

This places the filename of the file that needs to be reviewed into the
subject. Because it is going straight from excel, it also attaches the
file.
Which argument in DialogSendMail should be marked false so that the
attachment doesn't go and just the email does?

__________ Information from ESET Smart Security, version of virus
signature database 4285 (20090728) __________

The message was checked by ESET Smart Security.

http://www.eset.com





__________ Information from ESET Smart Security, version of virus signature database 4285 (20090728) __________

The message was checked by ESET Smart Security.

http://www.eset.com




Pam M

excel programming
 
My old friend Ron. Thanks for responding! Yes, we use Outlook.

"Ron de Bruin" wrote:

Hi Pam

You need other code to do this
Do you use Outlook ???



"Pam M" schreef in bericht
...
I have a macro that sends an automatic email from Excel to notify that a
file
needs to be reviewed.

Application.Dialogs(xlDialogSendMail).Show _
arg2:="MIX REQUEST: " & [JobName] & ".xls", arg3:=True

This places the filename of the file that needs to be reviewed into the
subject. Because it is going straight from excel, it also attaches the
file.
Which argument in DialogSendMail should be marked false so that the
attachment doesn't go and just the email does?

__________ Information from ESET Smart Security, version of virus
signature database 4285 (20090728) __________

The message was checked by ESET Smart Security.

http://www.eset.com





__________ Information from ESET Smart Security, version of virus signature database 4285 (20090728) __________

The message was checked by ESET Smart Security.

http://www.eset.com





Ron de Bruin

excel programming
 
Hi Pam

Try this


Sub Mail_small_Text_Outlook()
'Working in Office 2000-2007
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"

On Error Resume Next
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = ThisWorkbook.FullName 'or without path use
ThisWorkbook.Name
.Body = strbody
'You can add a file like this
'.Attachments.Add ("C:\test.txt")
.display 'or use .Display
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


"Pam M" schreef in bericht
...
My old friend Ron. Thanks for responding! Yes, we use Outlook.

"Ron de Bruin" wrote:

Hi Pam

You need other code to do this
Do you use Outlook ???



"Pam M" schreef in bericht
...
I have a macro that sends an automatic email from Excel to notify that a
file
needs to be reviewed.

Application.Dialogs(xlDialogSendMail).Show _
arg2:="MIX REQUEST: " & [JobName] & ".xls", arg3:=True

This places the filename of the file that needs to be reviewed into the
subject. Because it is going straight from excel, it also attaches the
file.
Which argument in DialogSendMail should be marked false so that the
attachment doesn't go and just the email does?

__________ Information from ESET Smart Security, version of virus
signature database 4285 (20090728) __________

The message was checked by ESET Smart Security.

http://www.eset.com





__________ Information from ESET Smart Security, version of virus
signature database 4285 (20090728) __________

The message was checked by ESET Smart Security.

http://www.eset.com





__________ Information from ESET Smart Security, version of virus
signature database 4285 (20090728) __________

The message was checked by ESET Smart Security.

http://www.eset.com





__________ Information from ESET Smart Security, version of virus signature database 4285 (20090728) __________

The message was checked by ESET Smart Security.

http://www.eset.com




Pam M

excel programming
 
Ron--tried this today...perfect. Once again, thank you for your brilliance.
Have a great day, Pam

"Pam M" wrote:

I have a macro that sends an automatic email from Excel to notify that a file
needs to be reviewed.

Application.Dialogs(xlDialogSendMail).Show _
arg2:="MIX REQUEST: " & [JobName] & ".xls", arg3:=True

This places the filename of the file that needs to be reviewed into the
subject. Because it is going straight from excel, it also attaches the file.
Which argument in DialogSendMail should be marked false so that the
attachment doesn't go and just the email does?



All times are GMT +1. The time now is 11:31 AM.

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