Body message - email

A

al007

Sub Mail_workbook_KI()

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dayrep = InputBox("Enter no. day of report.", Default:="0")
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "(e-mail address removed)"
.CC = ""
.BCC = ""
.Subject = Dayrep & "Day Revenue Report"
.Body = "'Please find attached the ' & dayrep & ' day report
'"
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub


Having problem with the body message - want it to read: 'Please find
attached the 10 day report - if Dayrep=10

Can anybody help pls
 
N

NickHK

al007,
Double quotes ", instead of single '.
Also, Option Explicit is your friend; you would have seen "dayrep" was not
being evaluated.

NickHK
 
A

al007

It does not work - pls give me correct code
thxs
al007,
Double quotes ", instead of single '.
Also, Option Explicit is your friend; you would have seen "dayrep" was not
being evaluated.

NickHK
 

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