njs27
Member
- Outlook version
- Outlook 2010 64 bit
- Email Account
- Exchange Server 2010
Hi all,
I've been coding at a basic/intermediate level with vba in Excel for a bit, but I'm trying to understand some things about the Outlook format and I'm getting confused.
I've been asked by my boss to make a group calendar, basically by taking all the appointments from everyone in the group's calendars (for which I have been given permission to view full details) and dumping them into an Excel sheet.
I've managed to pull all the pertinent information, with one exception on the recurrences. With my calendar, the .Start is that occurrence in the correct chronological order. With everyone else's calendars, the items show up in the correct chronological order, but the .Start date is always the same as the .PatternStartDate. For example, if there is a weekly recurring appt that began on Feb 1, 2013, for this month (July 2014), the olkApt.Start and the RP.PatternStartDate both say 2/1/13.... even though it shows up in the middle of the July 2014 appointments.
Is this something I can fix? Or perhaps there is something fundamental I am missing, being new to the outlook part of vba?
Thanks for any help you can provide... I appreciate it!!
I will include some of the code below
'Write appointments to spreadsheet
For Each olkApt In olkRes
'Only export appointments
If olkApt.Class = olAppointment Then
For Each olkRec In olkApt.Recipients
strLst = strLst & olkRec.Name & ", "
Next
If strLst <> "" Then strLst = Left(strLst, Len(strLst) - 2)
'Add a row for each field in the message you want to export
excWks.Cells(lngRow, 1) = olkApt.Subject
excWks.Cells(lngRow, 2) = Format(olkApt.Start, "mm/dd/yyyy")
'...
'etc
'...
If olkApt.IsRecurring = True Then
Set RP = olkApt.GetRecurrencePattern
excWks.Cells(lngRow, 10) = RP.RecurrenceType
excWks.Cells(lngRow, 12) = RP.DayOfWeekMask
excWks.Cells(lngRow, 14) = RP.Instance
excWks.Cells(lngRow, 15) = RP.Interval
excWks.Cells(lngRow, 16) = RP.PatternStartDate
excWks.Cells(lngRow, 17) = RP.PatternEndDate
'....
I've been coding at a basic/intermediate level with vba in Excel for a bit, but I'm trying to understand some things about the Outlook format and I'm getting confused.
I've been asked by my boss to make a group calendar, basically by taking all the appointments from everyone in the group's calendars (for which I have been given permission to view full details) and dumping them into an Excel sheet.
I've managed to pull all the pertinent information, with one exception on the recurrences. With my calendar, the .Start is that occurrence in the correct chronological order. With everyone else's calendars, the items show up in the correct chronological order, but the .Start date is always the same as the .PatternStartDate. For example, if there is a weekly recurring appt that began on Feb 1, 2013, for this month (July 2014), the olkApt.Start and the RP.PatternStartDate both say 2/1/13.... even though it shows up in the middle of the July 2014 appointments.
Is this something I can fix? Or perhaps there is something fundamental I am missing, being new to the outlook part of vba?
Thanks for any help you can provide... I appreciate it!!
I will include some of the code below
'Write appointments to spreadsheet
For Each olkApt In olkRes
'Only export appointments
If olkApt.Class = olAppointment Then
For Each olkRec In olkApt.Recipients
strLst = strLst & olkRec.Name & ", "
Next
If strLst <> "" Then strLst = Left(strLst, Len(strLst) - 2)
'Add a row for each field in the message you want to export
excWks.Cells(lngRow, 1) = olkApt.Subject
excWks.Cells(lngRow, 2) = Format(olkApt.Start, "mm/dd/yyyy")
'...
'etc
'...
If olkApt.IsRecurring = True Then
Set RP = olkApt.GetRecurrencePattern
excWks.Cells(lngRow, 10) = RP.RecurrenceType
excWks.Cells(lngRow, 12) = RP.DayOfWeekMask
excWks.Cells(lngRow, 14) = RP.Instance
excWks.Cells(lngRow, 15) = RP.Interval
excWks.Cells(lngRow, 16) = RP.PatternStartDate
excWks.Cells(lngRow, 17) = RP.PatternEndDate
'....