giggles2005
Member
- Outlook version
- Outlook 2013 32 bit
- Email Account
- Exchange Server
Hi all,
I'm hoping someone can help me.
I'd like to set up a recurring email within Outlook. I've been told that you can't schedule an email to send but I've been given a code to convert a calendar invite into an email (as its a calendar invite I can schedule it to send when I want) The only thing is that I can't get the invite to send with the doc/pic embedded into it the email body.It just skips this out and sends a blank email.
Would someone be able to take a look at the below and advise? I'd be really grateful! Let me know if you need any other info
Private Sub Application_Reminder(ByVal Item As Object)
Dim objMsg As MailItem
Dim objApp As AppointmentItem
Dim Att As Object
Dim filePath As String
Set objMsg = Application.CreateItem(olMailItem)
MsgBox "Email Tiggered"
'message is appointment
If Item.MessageClass <> "IPM.Appointment" Then Exit Sub
'The appointment is set as "Send Schedule Recurring Email" Category
If Item.Categories <> "Send Schedule Recurring Email" Then Exit Sub
'MsgBox Item.MessageClass
'MsgBox Item.Categories
'MsgBox Item.Location
'MsgBox Item.Subject
'MsgBox objMsg.Body
'MsgBox Environ("USERPROFILE")
'to get the path of the email attachment
tmpFolder = Environ("USERPROFILE")
'Add each attachment to email object to be sent
For Each Att In Item.Attachments
Embed.Object = ("\\TCFSH03\3087355$\My Pictures\Recurring Emails\EPICStarAwards")
objMsg.Attachments.Add ("\\TCFSH03\3087355$\My Pictures\Recurring Emails")
Kill filePath
Next Att
'send email object
objMsg.To = Item.Location
objMsg.Subject = Item.Subject
objMsg.Body = Item.Body
objMsg.Send
Set objMsg = Nothing
End Sub
I'm hoping someone can help me.
I'd like to set up a recurring email within Outlook. I've been told that you can't schedule an email to send but I've been given a code to convert a calendar invite into an email (as its a calendar invite I can schedule it to send when I want) The only thing is that I can't get the invite to send with the doc/pic embedded into it the email body.It just skips this out and sends a blank email.
Would someone be able to take a look at the below and advise? I'd be really grateful! Let me know if you need any other info
Private Sub Application_Reminder(ByVal Item As Object)
Dim objMsg As MailItem
Dim objApp As AppointmentItem
Dim Att As Object
Dim filePath As String
Set objMsg = Application.CreateItem(olMailItem)
MsgBox "Email Tiggered"
'message is appointment
If Item.MessageClass <> "IPM.Appointment" Then Exit Sub
'The appointment is set as "Send Schedule Recurring Email" Category
If Item.Categories <> "Send Schedule Recurring Email" Then Exit Sub
'MsgBox Item.MessageClass
'MsgBox Item.Categories
'MsgBox Item.Location
'MsgBox Item.Subject
'MsgBox objMsg.Body
'MsgBox Environ("USERPROFILE")
'to get the path of the email attachment
tmpFolder = Environ("USERPROFILE")
'Add each attachment to email object to be sent
For Each Att In Item.Attachments
Embed.Object = ("\\TCFSH03\3087355$\My Pictures\Recurring Emails\EPICStarAwards")
objMsg.Attachments.Add ("\\TCFSH03\3087355$\My Pictures\Recurring Emails")
Kill filePath
Next Att
'send email object
objMsg.To = Item.Location
objMsg.Subject = Item.Subject
objMsg.Body = Item.Body
objMsg.Send
Set objMsg = Nothing
End Sub