blackorchids2002
Member
- Outlook version
- Email Account
- Exchange Server
Hi Masters,
This is my very first time to post in the forum. I'll be needing your expertise on how to set the meeting request organizer's status as always free or busy but the required attendee's availability status as "Out of office".
I have created a VBA code in excel to automatically send the meeting request. I have seen the ".organizer" code to be associated in the appontment item - meeting request and I don't know how to use it.
I want to include the code ".Organizer = BusyStatus = 0".
Here is my code that I put on a module in Excel file:
Sub Appointment_PTO()
Dim oApp As Object, oApt As Object
'Turns off screen updating
Application.ScreenUpdating = False
'to create a clendar invite
Set oApp = CreateObject("Outlook.Application")
Set oApt = oApp.CreateItem(1)
On Error Resume Next
With oApt
'to select the dates on the selected check box
> Subject = "PTO REQUEST APPROVED"
If Sheets("PTO Request Form").CB8_Label.Caption = Chr(254) Then
CB = Sheets("PTO Request Form").CB8_Label.Caption = Chr(254)
> Start = Sheets("PTO Request Form").FDdateTextBox.Value
> End = Sheets("PTO Request Form").FDdateTextBox.Value
> AllDayEvent = True
End If
If Sheets("PTO Request Form").CB9_Label.Caption = Chr(254) And Sheets("PTO Request Form").AM_Label.Caption = Chr(254) Then
CB = Sheets("PTO Request Form").CB9_Label.Caption = Chr(254) And Sheets("PTO Request Form").AM_Label.Caption = Chr(254)
> AllDayEvent = False
> Start = Sheets("PTO Request Form").HDdateTextBox.Value & " " & "06:00 AM"
> End = Sheets("PTO Request Form").HDdateTextBox.Value & " " & "12:00 PM"
End If
If Sheets("PTO Request Form").CB9_Label.Caption = Chr(254) And Sheets("PTO Request Form").PM_Label.Caption = Chr(254) Then
CB = Sheets("PTO Request Form").CB9_Label.Caption = Chr(254) And Sheets("PTO Request Form").PM_Label.Caption = Chr(254)
> AllDayEvent = False
> Start = Sheets("PTO Request Form").HDdateTextBox.Value & " " & "12:00 PM"
> End = Sheets("PTO Request Form").HDdateTextBox.Value & " " & "06:00 PM"
End If
If Sheets("PTO Request Form").CB10_Label.Caption = Chr(254) Then
CB = Sheets("PTO Request Form").CB10_Label.Caption = Chr(254)
> Start = Sheets("PTO Request Form").MDdateTextBox1.Value
> End = Sheets("PTO Request Form").MDdateTextBox2.Value
> AllDayEvent = True
End If
> MeetingStatus = 1
> RequiredAttendees = ThisWorkbook.Sheets("PTO Request Form").SupNEmailTextBox.Value & " ," & ThisWorkbook.Sheets("PTO Request Form").EmpNEmailTextBox.Value
> BusyStatus = 3
> ReminderSet = False
> Attachments.Add ThisWorkbook.FullName
> Display
'.Send
End With
On Error GoTo 0
'Restores screen updating and release Outlook
Application.ScreenUpdating = True
Set oApt = Nothing
Set oApp = Nothing
End sub
Please help if it is really possible.
Thanks,
blackorchids
This is my very first time to post in the forum. I'll be needing your expertise on how to set the meeting request organizer's status as always free or busy but the required attendee's availability status as "Out of office".
I have created a VBA code in excel to automatically send the meeting request. I have seen the ".organizer" code to be associated in the appontment item - meeting request and I don't know how to use it.
I want to include the code ".Organizer = BusyStatus = 0".
Here is my code that I put on a module in Excel file:
Sub Appointment_PTO()
Dim oApp As Object, oApt As Object
'Turns off screen updating
Application.ScreenUpdating = False
'to create a clendar invite
Set oApp = CreateObject("Outlook.Application")
Set oApt = oApp.CreateItem(1)
On Error Resume Next
With oApt
'to select the dates on the selected check box
> Subject = "PTO REQUEST APPROVED"
If Sheets("PTO Request Form").CB8_Label.Caption = Chr(254) Then
CB = Sheets("PTO Request Form").CB8_Label.Caption = Chr(254)
> Start = Sheets("PTO Request Form").FDdateTextBox.Value
> End = Sheets("PTO Request Form").FDdateTextBox.Value
> AllDayEvent = True
End If
If Sheets("PTO Request Form").CB9_Label.Caption = Chr(254) And Sheets("PTO Request Form").AM_Label.Caption = Chr(254) Then
CB = Sheets("PTO Request Form").CB9_Label.Caption = Chr(254) And Sheets("PTO Request Form").AM_Label.Caption = Chr(254)
> AllDayEvent = False
> Start = Sheets("PTO Request Form").HDdateTextBox.Value & " " & "06:00 AM"
> End = Sheets("PTO Request Form").HDdateTextBox.Value & " " & "12:00 PM"
End If
If Sheets("PTO Request Form").CB9_Label.Caption = Chr(254) And Sheets("PTO Request Form").PM_Label.Caption = Chr(254) Then
CB = Sheets("PTO Request Form").CB9_Label.Caption = Chr(254) And Sheets("PTO Request Form").PM_Label.Caption = Chr(254)
> AllDayEvent = False
> Start = Sheets("PTO Request Form").HDdateTextBox.Value & " " & "12:00 PM"
> End = Sheets("PTO Request Form").HDdateTextBox.Value & " " & "06:00 PM"
End If
If Sheets("PTO Request Form").CB10_Label.Caption = Chr(254) Then
CB = Sheets("PTO Request Form").CB10_Label.Caption = Chr(254)
> Start = Sheets("PTO Request Form").MDdateTextBox1.Value
> End = Sheets("PTO Request Form").MDdateTextBox2.Value
> AllDayEvent = True
End If
> MeetingStatus = 1
> RequiredAttendees = ThisWorkbook.Sheets("PTO Request Form").SupNEmailTextBox.Value & " ," & ThisWorkbook.Sheets("PTO Request Form").EmpNEmailTextBox.Value
> BusyStatus = 3
> ReminderSet = False
> Attachments.Add ThisWorkbook.FullName
> Display
'.Send
End With
On Error GoTo 0
'Restores screen updating and release Outlook
Application.ScreenUpdating = True
Set oApt = Nothing
Set oApp = Nothing
End sub
Please help if it is really possible.
Thanks,
blackorchids