Replying to calendar item using VBA

Status
Not open for further replies.

Pd6cbr

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server
Hello, Wondering if someone can help me. I have created this Macro to reply to emails with a template. It works great until I try and reply to a meeting invite. I get a type mismatch error and I am thinking that it may be that these are .ics items and that's causing the issue. Any help would be much appreciated. VBA code found below.

Sub ReplyAll()
Dim origEmail As Object
Dim replyEmail As Object
Set origEmail = GetCurrentItem()
Set replyEmail = Application.CreateItemFromTemplate("C:\Users\Meeting Minutes.oft")
replyEmail.HTMLBody = replyEmail.HTMLBody & origEmail.Reply.HTMLBody
replyEmail.Subject = origEmail.Subject + " - Meeting Minutes"
replyEmail.To = origEmail.To
replyEmail.CC = origEmail.CC
replyEmail.Display
End Sub

Function GetCurrentItem() As Object
Dim objApp As Outlook.Application

Set objApp = Application
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
End Select

Set objApp = Nothing
End Function
 
Which line does it error on? if you aren't sure, use step into command to watch it line by line.

It probably is due to the meeting items, or read receipts, non-delivery reports or other non-mail items.

When i tried it with a meeting response, it errored on the to and cc lines.
 
Thanks Diane, the error is a run-time error '438' Object doesn't support this property or method and it happens on the
replyItem.HTMLBody line. I know that within a meeting invite there is a contact attendees button and you can reply all with email. Is there any way to tap into that functionality?
 
I found another script and combined the two using an if statement. That way a meeting was handled correctly and if it failed the email script above took over. I also had to change the restriction of just people who had not responded so that all people from the meeting get the email.

Send an email to attendees who have not responded

Thank you,
Peter
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
E Replying to a plain text e-mail with HTML Using Outlook 2
U Outlook locking up when replying to Email Using Outlook 7
T Original email text not shown when replying or forwarding the email. Using Outlook 9
S Customize the autocolor font choices for replying/forwarding messages Outlook VBA and Custom Forms 2
R Disable conversation thread from replying of recipients in the same subject. Please help Using Outlook 0
N Macro to move all recipients to CC while replying Outlook VBA and Custom Forms 0
B Looking to get the Recipient email address (or even the "friendly name") from an email I am replying to using VBA Outlook VBA and Custom Forms 4
mctabish Replying to an email if received in several inboxes Outlook VBA and Custom Forms 2
R Setting font and color used when replying to an email Outlook VBA and Custom Forms 3
J Help Please!!! Outlook 2016 - VBA Macro for replying with attachment in meeting invite Outlook VBA and Custom Forms 9
S Received mail as part of DL, need to auto-CC the same when replying Outlook VBA and Custom Forms 5
V VBA when replying + Default Account Using Outlook 2
Mark Foley Outlook multi-spacing Thunderbird signatures when replying Using Outlook 0
D Macro to scan email distribution list when replying Using Outlook 2
G VBA/Macro to remove page colour when replying or forwarding email Outlook VBA and Custom Forms 2
S Save in folder other than Sent when replying with Quick Steps Using Outlook 5
D VBA Code to strip Subject Line when replying or forwarding Using Outlook 3
O Setting default format for composing/replying to emails Using Outlook 3
J Macro for replying to One Email with another Using Outlook 1
H "Normal" Style Changes When Replying Using Outlook 4
T To: and Cc: not displaying when forwarding/replying to .eml files Using Outlook 4
V Reply Arrow Icon appears when both Replying or Forwarding Using Outlook 3
A Form disappears when replying to it Using Outlook 4
F Script needed for replying to email address in body of receiving email Using Outlook 46
J How do I get rid of the underscores when replying to a message in Outlook 2010 Using Outlook 6
K Automatically Change "From" Address When Replying As An Alias? Using Outlook 5
S Changing Double-Space Default When Replying To Emails Using Outlook 2
M Font Size Too Small When Replying and Sendig Emails on Outlook 2007 Using Outlook 1
C Open message is stuck minimized -Odd behavior when replying to a message(2010) Using Outlook 1
W Email becomes "unread" after replying to it. Using Outlook 8
K Move conversation to folder after replying Using Outlook 1
B How to automatic save Sending or replying contacts e-mails into contacts? Using Outlook 0
O Different colors when replying messages Using Outlook 1
D Formatting Styles when Replying Using Outlook 10
S Blank body when replying with an Outlook Form. Using Outlook 21
S Outlook 2007 Macro for replying to an e-mail. Outlook VBA and Custom Forms 1
D How to retain attachments in message when replying to sender Using Outlook 4
D Deleting a message from your inbox after replying. Outlook VBA and Custom Forms 1
M Button for 'When Replying to a Message' Settings Outlook VBA and Custom Forms 1
C Persist the email format and attachments / images while replying A Outlook VBA and Custom Forms 5
F Sync Outlook Calendar Using Outlook 0
F Show events in Monthly Calendar Using Outlook 3
E Subscribing to another calendar when each party uses Office 365 Family Using Outlook 3
M Retaining old contacts and calendar in new account setup Using Outlook 6
P Email and calendar entry text now shifts right about 3 tabs worth of space Using Outlook 1
N Best way to sync calendar and contacts between Outlook 365 and Outlook on iPhone Using Outlook 4
H Macro to Delete Duplicate items in Outlook calendar where title is the same and date is the same Outlook VBA and Custom Forms 0
J Emails with .ICS calendar invitations attached don't contents when received in Outlook 365 Using Outlook 6
O Any 3rd party tool that sync (mirror) from Outlook Calendar to Google Calendar? Using Outlook 5
Fozzie Bear Calendar Events created on iPhone have suddenly start sending invitations to attendees Using Outlook 2

Similar threads

Back
Top