Meeting Item SentOn Value

Status
Not open for further replies.

opiket

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
I'm outlook 2007 sp3 (12.0.6662.5000). I'm trying to use VBA to: convert an open Meeting Item to my local calendar and ask if I want to forward the Meeting Item. If I do, I want to get the Date\Time it was forwarded. But after I issue the .Send command, I cant access any of the Meeting Item's properties such as .SentOn. I receive an error message box saying "Run Time Error...The item has been moved or deleted." Here's my code: Sub MeetingRequest2() On Error GoTo Err_MeetingRequest: Const conPropTag As String = "http://schemas.microsoft.com/mapi/conPropTag/" Dim bytResponse As Byte Dim intRetVal As Integer Dim objApptFd As MeetingItem Dim objRequest As MeetingItem Dim objResponse As MeetingItem Dim objItems As Outlook.Items Dim objItemsInDateRange As Outlook.Items Dim objApptOri As Outlook.AppointmentItem Dim strForwardedTo As String Dim strRestriction As String Dim strTemp As String ' get open message '****************************************************************************************************** Set objRequest = GetCurrentItem() If TypeName(objRequest) "MeetingItem" Then MsgBox "'" & objRequest.Subject & "' is not a meeting request." & vbCrLf & vbCrLf & "Code will exit" GoTo Exit_MeetingRequest End If 'save currently open meeting to appointment Set objApptOri = objRequest.GetAssociatedAppointment(True) Set objResponse = objApptOri.Respond(3) objResponse.Send 'forward intRetVal = MsgBox("For " & vbCrLf & "'" & objApptOri.Subject & "'" & vbCrLf & vbCrLf _ & "Forward ?", vbDefaultButton1 + vbQuestion + vbYesNo, "Calendar Appointment") If intRetVal = vbYes Then Set objApptFd = objRequest.Forward objApptFd.Recipients.Add ("a@hotmail.com") objApptFd.Send strTemp = objApptFd.SentOn End If Exit_MeetingRequest: Exit Sub Err_MeetingRequest: MsgBox Err.Number & vbCrLf & Err.Description, vbCritical, "MeetingRequest" Resume Exit_MeetingRequest End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You need to set the string before send

strTemp = objApptFd.SentOn

objApptFd.Send

Code:
Sub MeetingRequest2() 
 
On Error GoTo Err_MeetingRequest: 
 
Const conPropTag  As String = "http://schemas.microsoft.com/mapi/conPropTag/" 
 
Dim bytResponse As Byte 
 
Dim intRetVal As Integer 
 
Dim objApptFd As MeetingItem 
 
Dim objRequest As MeetingItem 
 
Dim objResponse As MeetingItem 
 
Dim objItems As Outlook.Items 
 
Dim objItemsInDateRange As Outlook.Items 
 
Dim objApptOri As Outlook.AppointmentItem 
 
Dim strForwardedTo As String 
 
Dim strRestriction As String 
 
Dim strTemp As String 
 
' get open message 
 
'****************************************************************************************************** 
 
Set objRequest = GetCurrentItem() 
 
If TypeName(objRequest) <> "MeetingItem" Then 
 
MsgBox "'" & objRequest.Subject & "' is not a meeting request." & vbCrLf & vbCrLf & "Code will exit" 
 
GoTo Exit_MeetingRequest 
 
End If 
 
'save currently open meeting to appointment 
 
Set objApptOri = objRequest.GetAssociatedAppointment(True) 
 
Set objResponse = objApptOri.Respond(3) 
 
objResponse.Send 
 
'forward 
 
intRetVal = MsgBox("For " & vbCrLf & "'" & objApptOri.Subject & "'" & vbCrLf & vbCrLf _ 
 
& "Forward ?", vbDefaultButton1 + vbQuestion + vbYesNo, "Calendar Appointment") 
 
If intRetVal = vbYes Then 
 
Set objApptFd = objRequest.Forward 
 
objApptFd.Recipients.Add ("a@hotmail.com") 
 
strTemp = objApptFd.SentOn 
 
objApptFd.Send 
 
End If 
 
Exit_MeetingRequest:  ' 
 
Exit Sub 
 
Err_MeetingRequest:     MsgBox Err.Number & vbCrLf & Err.Description, vbCritical, "MeetingRequest" 
 
Resume Exit_MeetingRequest 
 
End Sub
 

opiket

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Thanks for the response. I've tried that before, and I just tried it again, and it returns "1/1/4501". I've Google'd that and the answers say "1/1/4501" means "not yet sent". What am I missing ? Thanks
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Oh. Yeah, that won't work. How about just using "Now" since you are going to send it right away anyway?

strTemp = format(now, "mm/dd/yyyy hh:mm")
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D After Moving or Deleting Open Item - Meeting Requests Using Outlook 4
G Outlook 2007 Meeting Item Send Button Outlook VBA and Custom Forms 10
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1
P Scheduling a meeting in Outlook Outlook Wishlist 3
S Skype for business meeting vba code Outlook VBA and Custom Forms 1
A Unable to save recurring Meeting to Documents folder due to error Using Outlook 2
S Meeting with Time Slots Using Outlook 2
egarneau Meeting updates with external contacts (GMail) Using Outlook 1
L automaticaly create a teams meeting with a sync Using Outlook 0
R auto send email when meeting closes from a shared calendar only Outlook VBA and Custom Forms 2
S Meeting Invite arrives from Wrong ("send-as") Sender Using Outlook 1
Daniel Schunk Meeting responses are not shown in the status area Using Outlook 2
A End-time meeting reminder (or "negative" time relative to the meeting start time) Using Outlook 1
J Help Please!!! Outlook 2016 - VBA Macro for replying with attachment in meeting invite Outlook VBA and Custom Forms 9
T Pick-a-Meeting in Outlook 365 New Slipstick.com Articles 2
J No response required when delegate arranging meeting Using Outlook 0
S Accepting meeting request from calendar keeps the meeting request in the inbox Using Outlook 2
D Add all meeting rooms to the meeting request by default Outlook VBA and Custom Forms 0
Rick Rickert Would like bigger meeting notifications. Using Outlook 3
G Auto accept meeting request for non primary account Outlook VBA and Custom Forms 1
D Next Available Meeting with Userform Variables Outlook VBA and Custom Forms 1
J Outlook 2016 shows Meeting Organizer in Calendar View Using Outlook 5
C Update Notes for Meeting Attendees Using Outlook 8
D Outlook macros to create meeting on shared calendar Outlook VBA and Custom Forms 10
P Skype contact icons have disappeared at the bottom of email and meeting objects Using Outlook 2
T Double clik behavior on agenda open a new meeting request Using Outlook 1
B How to get Meeting Invitations into Outlook.com calendar? Using Outlook 2
Diane Poremsky Autoaccept a Meeting Request using Rules New Slipstick.com Articles 2
Diane Poremsky Close a Meeting When the Room is Full New Slipstick.com Articles 0
A Attendee Update Outlook Meeting Invite Using Outlook 0
Diane Poremsky iPhone and the Meeting Request Bug New Slipstick.com Articles 0
P Receiving a Meeting Declined notice for a recurring meeting Using Outlook 0
A Customize meeting form. Private notices Outlook VBA and Custom Forms 3
A VBA to create meeting from template from a time slot selected in someone's calendar Outlook VBA and Custom Forms 5
Diane Poremsky Meeting Location Warning Message New Slipstick.com Articles 0
B Meeting Accept option greyed out Using Outlook 0
A Custom form not showing when recurrence is set for a meeting Using Outlook 0
S Meeting room booking report Outlook VBA and Custom Forms 1
Diane Poremsky How to Create a Pick-a-Meeting Request New Slipstick.com Articles 0
Britonius Locate Cause of Deleted Meeting Using Outlook 0
C Problem tracking meeting responses Using Outlook 3
I Creating meeting invite with disabled tentative button Outlook VBA and Custom Forms 5
GoofyDK Office365 and meeting ressources Using Outlook 2
G how to cancel a recurring meeting but not the organizer but all attendees need to know. Using Outlook 1
O Add private notes or comments to Outlook meeting invite Using Outlook 4
R Declining Meeting Using Outlook 2
D Meeting Request - Too Many Recipients Using Outlook 0
E Meeting reminders are set for the recipient Exchange Server Administration 9
P Viewing Meeting Organizer on room Mailbox Using Outlook 1
Diane Poremsky Delegates, Meeting Requests, and Rules New Slipstick.com Articles 0

Similar threads

Top