-
Solved: noob sent email question
Hi, this is my first time writing a macro in outlook, can someone tell me what is wrong with this.
[VBA]
Option Explicit
Sub dailyexitandarrival()
Dim objmail As Outlook.MailItem
Dim myattachements As Collection
Set objmail = Outlook.CreateItem(olMailItem)
With objmail
.BodyFormat = olFormatPlain
.Body = "Good Morning All, attached is Daily Exits and Arrivals. Please Click cancel when asked to updated."
.Display
.To = "John@smith.com"
End With
Set myattachements = objmail.Attachments
myattachements.Add "C:\\daily-arrivals-exits.ppt"
objmail.Send
End Sub
[/VBA]
-
Try this
[VBA]
Sub dailyexitandarrival()
Dim objmail As Outlook.MailItem
Dim myattachements As Collection
Set objmail = Outlook.CreateItem(olMailItem)
With objmail
.BodyFormat = olFormatPlain
.Body = "Good Morning All, attached is Daily Exits and Arrivals. Please Click cancel when asked to updated."
.Display
.To = "John@smith.com"
.Attachments.Add "C:\daily-arrivals-exits.ppt"
End With
End Sub
[/VBA]
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules