Schedule recurring email and attachments display

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
smile.gif


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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Do you want to add the attachments or embed them? To move attachments from the appointment to the message, use the CopyAttachments sub -



Code:
objMsg.To = Item.Location
objMsg.Subject = Item.Subject

  CopyAttachments Item, objMsg

objMsg.Body = Item.Body
objMsg.Send


Code:
Sub CopyAttachments(objSourceItem, objTargetItem)
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set fldTemp = fso.GetSpecialFolder(2) ' TemporaryFolder
   strPath = fldTemp.Path & "\"
   For Each objAtt In objSourceItem.Attachments
      strFile = strPath & objAtt.FileName
      objAtt.SaveAsFile strFile
      objTargetItem.Attachments.Add strFile, , , objAtt.DisplayName
      fso.DeleteFile strFile
   Next
 
   Set fldTemp = Nothing
   Set fso = Nothing
End Sub


Item
 

giggles2005

Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
Does the image change each time? If not, add it to the appt body. I'll also test it to see if i can get it to work attaching it later.
Hi Diane,
I’ve tried adding it as an object to the appointment body but when it sends it doesn’t appear in the email. No idea why!
Do you want to add the attachments or embed them? To move attachments from the appointment to the message, use the CopyAttachments sub -



Code:
objMsg.To = Item.Location
objMsg.Subject = Item.Subject

  CopyAttachments Item, objMsg

objMsg.Body = Item.Body
objMsg.Send


Code:
Sub CopyAttachments(objSourceItem, objTargetItem)
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set fldTemp = fso.GetSpecialFolder(2) ' TemporaryFolder
   strPath = fldTemp.Path & "\"
   For Each objAtt In objSourceItem.Attachments
      strFile = strPath & objAtt.FileName
      objAtt.SaveAsFile strFile
      objTargetItem.Attachments.Add strFile, , , objAtt.DisplayName
      fso.DeleteFile strFile
   Next
 
   Set fldTemp = Nothing
   Set fso = Nothing
End Sub


Item
id like to embed the attachment. Does that affect the code?
 
Similar threads
Thread starter Title Forum Replies Date
E Work uses live accounts for emails for all employees. Can we use the outlook calendar to give the employees an universal work schedule calendar? Using Outlook 1
R Macro Schedule every day in Outlook Using Outlook 0
Diane Poremsky Running Outlook Macros on a Schedule Using Outlook 0
B changing Win7 default backup schedule for Previous Versions Using Outlook 0
M print free/busy schedule of an user Using Outlook 2
L Schedule Assistant shows wrong working hours Using Outlook 1
M Don't have permission to schedule meetings on behalf Using Outlook 1
B Schedule future emails Outlook VBA and Custom Forms 4
V Outlook 2016 Multiple recurring tasks getting created Using Outlook 0
S Changing colors of today's appointments, but not recurring ones Using Outlook 33
G Recurring tasks break links Outlook 2016 Using Outlook 5
A Unable to save recurring Meeting to Documents folder due to error Using Outlook 2
K Recurring all day annual event Using Outlook 3
P Restore an individual all-day recurring event Using Outlook 2
F Year-and-a-day recurring appointments Using Outlook 1
P Receiving a Meeting Declined notice for a recurring meeting Using Outlook 0
N Recurring invite sent w/distribution list adding/removing attendees Using Outlook 0
C Recurring Task End Date Varies Using Outlook 3
M Expected behaviour of recurring appointments? Using Outlook 2
K Outlook 2013 Recurring Tasks Not Showing Complete Outlook.com Using Outlook.com accounts in Outlook 1
G how to cancel a recurring meeting but not the organizer but all attendees need to know. Using Outlook 1
L Recurring Tasks lost Using Outlook 3
M Recurring icon for custom form task item Outlook VBA and Custom Forms 6
Diane Poremsky Scheduling a Recurring Message Using Outlook 0
Diane Poremsky Scheduling a Recurring Message Using Outlook 0
L Who Deleted My Recurring Meeting? Exchange Server Administration 6
T outlook cal for mac changes times of recurring meetings on its own Using Outlook 1
F Recurring meeting with recurring prep. 2 days before Using Outlook 1
Mr Mayor Another recurring meeting question Using Outlook 1
J Recurring meeting - i require a monthly accept confrimation Using Outlook 1
T The Formatting Changes When A Recurring Appointment is Changed Using Outlook 1
S Modify recurring outlook invites based on form entry Using Outlook 0
S How to script for a recurring task Using Outlook 0
I VBA Recurring Task Converted From Email Using Outlook 2
M Recurring invitations for a recurring meeting Using Outlook 3
M outlook recurring item stucks me. :( Exchange Server Administration 1
M Email address included automatically in the recurring meeting Using Outlook 4
S Recurring Task / Delayed Email in Outlook 2010 Outlook Wishlist 10
L Setting up recurring meeting for every thursday except 3rd thursday Using Outlook 3
M How to skip weekends on recurring appointments - OL2010? Using Outlook 4
D Priting only Recurring Appointments in Outlook Calendar 2010 Using Outlook 1
X Can you get outlook to ignore certain weeks for recurring meetings? Using Outlook 1
D Updating a recurring meeting cuses a reminder to be sent for every occurence. Using Outlook 2
B weekday recurring appointments Using Outlook 1
J Recurring Appointments With A Twist Using Outlook 3
P Delete Recurring Meeting Invite Using Outlook 4
A Recurring meeting sending a invite for each meeting Using Outlook 1
G Weekly recurring appointments based on 6 month rotation Using Outlook 2
D Recurring Tasks Problem? Using Outlook 5
B Restoring Deleted Recurring Event AND Notes Using Outlook 8

Similar threads

Top