1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
| Sub ListAppointments()
Dim olApp As Object
Dim olNS As Object
Dim olFolder As Object
Dim olApt As Object
Dim NextRow As Long
Cells.Select
Selection.ClearContents
Range("A1").Select
Set olApp = CreateObject("Outlook.Application")
Set olNS = olApp.GetNamespace("MAPI")
Set olFolder = olNS.GetDefaultFolder(9) 'olFolderCalendar
Range("A1:AH1").Value = Array("Subject", "Start", "End", "Location", "Body", "Duration", "ForceUpdateToAllAttendees", "GlobalAppointmentID", "IsOnlineMeeting", "IsRecurring", "MeetingStatus", "MeetingWorkspaceURL", "NetMeetingAutoStart", "NetMeetingDocPathName", "NetMeetingOrganizerAlias", "NetMeetingServer", "NetMeetingType", "NetShowURL", "Organizer", "RequiredAttendees", "OptionalAttendees", "RecurrenceState", "ReminderMinutesBeforeStart", "ReplyTime", "Resources", "ResponseRequested", "ResponseStatus", "ClearRecurrencePattern", "GetRecurrencePattern", "Sensitivity", "Size", "Categories", "StartTimeZone", "EndTimeZone")
NextRow = 2
'help: http://www.dimastr.com/redemption/RDOAppointmenItem.htm
'help: http://msdn.microsoft.com/en-us/library/office/cc513841%28v=office.12%29.aspx
'help: http://msdn.microsoft.com/en-us/library/office/microsoft.office.interop.outlook._appointmentitem_members%28v=office.14%29.aspx
'help: http://msdn.microsoft.com/en-us/library/exchange/aa564765%28v=exchg.140%29.aspx
For Each olApt In olFolder.Items
If olApt.Subject Like "**" Then
Cells(NextRow, "A").Value = olApt.Subject
Cells(NextRow, "B").Value = olApt.Start
Cells(NextRow, "C").Value = olApt.End
Cells(NextRow, "D").Value = olApt.Location
Cells(NextRow, "E").Value = olApt.Body
Cells(NextRow, "F").Value = olApt.Duration
Cells(NextRow, "G").Value = olApt.ForceUpdateToAllAttendees
Cells(NextRow, "H").Value = olApt.GlobalAppointmentID
Cells(NextRow, "I").Value = olApt.IsOnlineMeeting
Cells(NextRow, "J").Value = olApt.IsRecurring
Cells(NextRow, "K").Value = olApt.MeetingStatus
Cells(NextRow, "L").Value = olApt.MeetingWorkspaceURL
Cells(NextRow, "M").Value = olApt.NetMeetingAutoStart
Cells(NextRow, "N").Value = olApt.NetMeetingDocPathName
Cells(NextRow, "O").Value = olApt.NetMeetingOrganizerAlias
Cells(NextRow, "P").Value = olApt.NetMeetingServer
Cells(NextRow, "Q").Value = olApt.NetMeetingType
Cells(NextRow, "R").Value = olApt.NetShowURL
Cells(NextRow, "S").Value = olApt.Organizer
Cells(NextRow, "T").Value = olApt.RequiredAttendees
Cells(NextRow, "U").Value = olApt.OptionalAttendees
Cells(NextRow, "V").Value = olApt.RecurrenceState
Cells(NextRow, "W").Value = olApt.ReminderMinutesBeforeStart
Cells(NextRow, "X").Value = olApt.ReplyTime
Cells(NextRow, "Y").Value = olApt.Resources
Cells(NextRow, "Z").Value = olApt.ResponseRequested
Cells(NextRow, "AA").Value = olApt.ResponseStatus
Cells(NextRow, "AB").Value = olApt.ClearRecurrencePattern
Cells(NextRow, "AC").Value = olApt.GetRecurrencePattern
Cells(NextRow, "AD").Value = olApt.Sensitivity
Cells(NextRow, "AE").Value = olApt.Size
Cells(NextRow, "AF").Value = olApt.Categories
Cells(NextRow, "AG").Value = olApt.StartTimeZone
Cells(NextRow, "AH").Value = olApt.EndTimeZone
NextRow = NextRow + 1
End If
Next olApt
Range("A1").Select
Selection.AutoFilter
Set olApt = Nothing
Set olFolder = Nothing
Set olNS = Nothing
Set olApp = Nothing
Columns.AutoFit
End Sub |
Partager