excel programming

P

Pam M

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?
 
R

Ron de Bruin

Hi Pam

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



Pam M said:
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
 
P

Pam M

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

Ron de Bruin said:
Hi Pam

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



Pam M said:
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
 
R

Ron de Bruin

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 = "(e-mail address removed)"
.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 said:
My old friend Ron. Thanks for responding! Yes, we use Outlook.

Ron de Bruin said:
Hi Pam

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



Pam M said:
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
 
P

Pam M

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

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