S
saabi
I have a simple macro(pasted below), trying to attach a
calendar item to emails sent (mail merge doesn't allow me
to embed a calendar invite directly). I get a 'Type
Mismatch' error. The error is thrown at the 'For' loop
statement. Any help would be much appreciated.
Thanks
Sub AddAttachments()
Dim myOutbox As MAPIFolder
Set myOutbox = Application.Session.GetDefaultFolder
(olFolderOutbox)
Dim myMailItem As MailItem
For Each myMailItem In myOutbox.Items
myMailItem.Attachments.Add ("Path to my Calendar
file")
myMailItem.Send
Next
End Sub
calendar item to emails sent (mail merge doesn't allow me
to embed a calendar invite directly). I get a 'Type
Mismatch' error. The error is thrown at the 'For' loop
statement. Any help would be much appreciated.
Thanks
Sub AddAttachments()
Dim myOutbox As MAPIFolder
Set myOutbox = Application.Session.GetDefaultFolder
(olFolderOutbox)
Dim myMailItem As MailItem
For Each myMailItem In myOutbox.Items
myMailItem.Attachments.Add ("Path to my Calendar
file")
myMailItem.Send
Next
End Sub