Appointment occurrences change the location property

Outlook version
Outlook 2016 32 bit
Email Account
Outlook.com (as MS Exchange)
#1
Hello all,

I have a second very weird observation. Using the code below, I loop over appointment items in my own default calendar. It's for a timesheet application.
Some of the appointments are recurring. I want to retrieve the location (and other properties) all appointments and fill it a listbox to count hours by location, ...
Now, here's the code:

Code:
Private Sub btn_Count_Hits_Per_Item_Click()

    Dim oFinalItems           As Variant         'Outlook.Items
    Dim oAppt                 As Outlook.AppointmentItem
    Dim sCategory             As String
    Dim sCategories           As String
    Dim sLocation             As String

    Set oFinalItems = Get_Appt_Items_In_Time_Range_Filtered(2018, 10, False, tbx_Start_Date.Text, tbx_End_Date.Text, fiRecurring)

    If oFinalItems Is Nothing Then
        MsgBox "No appointments match the selections. Please amend.", vbInformation
        Exit Sub
    End If

    For Each oAppt In oFinalItems
  
        'MsgBox oAppt.MessageClass

        'LOCATIONS
        sLocation = Trim(oAppt.Location)

    Next

End Sub
If I ask for the Location property with MessageClass in commentary signs, I get the Location from the appointment master.
If I ask for the Location property with the MessageClass msgbox active, I get the Location from the appointment occurrence.
These 2 happen to be different. In both cases I get though:

oappt.RecurrenceState = olApptOccurrence

The EntryID of the appointment is exactly the same in both cases.

The fiRecurring argument means that the called function should include recurring apptm. items too.
It all works fine except for this change in property value.

What is going on here please ? Is there an implicit change once you ask for any property ?
Do I have to approach recurring items in a different way (==> please share code examples and I will work it out) ?

Puzzled... Thanks a lot !
 

Similar threads

Top