thegameoflife
Programmer
for some reason vba does not like 12/23/2002 when attaching an attachment in outlook. So how can I change the date to mm-dd-yyyy?
Code:
Function mail_report()
Dim oMailApp As Outlook.Application
Dim oMail As Outlook.MailItem
Dim Reportname As String
Reportname = "C:\Data\Reports\HighDollar\HighDollar for " & Date & ".xls"
Set oMailApp = CreateObject("Outlook.Application")
Set oMail = oMailApp.CreateItem(olMailItem)
With oMail
.TO = "HighDollar"
.Subject = "Report Test"
.Body = "HighDollar Report "
.Importance = olImportanceLow
.Sensitivity = olPrivate
.Attachments.Add Reportname
.Display
'.Send
End With
End Function