Created
March 5, 2025 09:56
-
-
Save timendum/787ca6cb241fa2b315ad4d2838b45ddb to your computer and use it in GitHub Desktop.
Macro to clone a calendar in Outlook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub CloneCalendarItem() | |
Dim objApp As Outlook.Application | |
Dim objSelection As Outlook.Selection | |
Dim objItem As Object | |
Dim objNewItem As Outlook.AppointmentItem | |
Set objApp = Outlook.Application | |
Set objSelection = objApp.ActiveExplorer.Selection | |
If objSelection.Count > 0 Then | |
Set objItem = objSelection.Item(1) | |
If TypeOf objItem Is Outlook.AppointmentItem Then | |
Set objNewItem = objApp.CreateItem(olAppointmentItem) | |
With objNewItem | |
.Subject = objItem.Subject | |
.RequiredAttendees = objItem.RequiredAttendees | |
.OptionalAttendees = objItem.OptionalAttendees | |
.MeetingStatus = olMeeting ' Set the item as a meeting | |
.Body = "" ' Empty body | |
.Display | |
End With | |
Else | |
MsgBox "Please select a calendar item.", vbExclamation | |
End If | |
Else | |
MsgBox "Selected one item.", vbExclamation | |
End If | |
End Sub | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment