Appointment occurrences change the location property

Status
Not open for further replies.

Wigi

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Outlook.com (as MS Exchange)
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 !
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
A Appointment recurrence reset to 'end after 25 occurrences' Using Outlook 1
Chiba Create an appointment for all the members Outlook VBA and Custom Forms 1
D Prevent popup of "Do you want to save changes?" when closing after opening an appointment to view Outlook VBA and Custom Forms 2
O Calendar - appointment templates and categories Using Outlook 1
W Appointment userproperties disappear Outlook VBA and Custom Forms 4
Nessa Can't create new appointment Using Outlook 1
F Appointment Show All Fields Using Outlook 1
C Trying to populate an appointment ComboBox from Excel Outlook VBA and Custom Forms 2
A Possible to hide ribbon with custom appointment form? Outlook VBA and Custom Forms 3
W Space in an Outlook appointment body Using Outlook 0
Dave A Run macro on existing appointment when it changes Outlook VBA and Custom Forms 1
JoeG Appointment Delete/Change Recurrence Outlook VBA and Custom Forms 0
S Display PF contact folder items to select contact to link to appointment Outlook VBA and Custom Forms 1
M Forward Appointment as BCC with VBScript Outlook VBA and Custom Forms 7
K Update Appointment category when changed in Excel Using Outlook 3
S View Appointment in Text Wrap in Outlook 2007 Month Calendar View Using Outlook 0
A Day view - print appointment details Calendar Printing Assistant 1
R Recover Deleted Appointment in Calendar Using Outlook 0
N Select Appointment subject line from combobox or list Outlook VBA and Custom Forms 1
S Appointment-Cannot set Categories because ConversationID is not set Outlook VBA and Custom Forms 1
D Record Appointment to Calendar on "Public Folder" Outlook VBA and Custom Forms 13
G Copy Contact field to Appointment Custom Form Field Outlook VBA and Custom Forms 2
G How to Copy Multi Select Listbox Data to Appointment Outlook VBA and Custom Forms 3
S Appointment colour categories disappear Using Outlook 4
G Using Data From Combo Box in Appointment Body Outlook VBA and Custom Forms 6
C Set reminder / appointment by right clicking email Using Outlook 1
A Add attachments to appointment based on field values Outlook VBA and Custom Forms 0
S how to set user properties to a newly created appointment Outlook VBA and Custom Forms 12
Y Creating custom appointment request form with multiple mail recipients Outlook VBA and Custom Forms 5
S my vbscript button1_click code works on appointment created but not on opening an existing apntmn Outlook VBA and Custom Forms 16
G Create an Appointment at the Contact's Address From Email Outlook VBA and Custom Forms 0
Diane Poremsky Create Task or Appointment and Insert Selected Text New Slipstick.com Articles 0
Pierce007 Maps/location in making an appointment Using Outlook 2
A Get shared calendar name or id in custom appointment form Using Outlook 0
Diane Poremsky Create Appointment From Email Automatically New Slipstick.com Articles 0
C Reminder for single-click appointment Using Outlook 2
P Appointment times are off by one minute Using Outlook 1
M receive mail when appointment category changes and create task from appointment Outlook VBA and Custom Forms 0
B VBA Code to create appointment from email Outlook VBA and Custom Forms 1
Diane Poremsky Create an Outlook appointment from an email message New Slipstick.com Articles 4
Diane Poremsky Create an Appointment Diary New Slipstick.com Articles 0
N Adding Appointment Item in Outlook to Shared Calendar Folder Outlook VBA and Custom Forms 7
Diane Poremsky Send an Email When You Add an Appointment to Your Calendar New Slipstick.com Articles 0
J Outlook calendar...How to add an event or appointment without a border around it? Using Outlook 9
F Outlook 2010 Search Appointment Notes Using Outlook 0
D Calendar appointment, type 2 Using Outlook 2
Diane Poremsky Use VBA to get an Appointment's Time Zone New Slipstick.com Articles 0
C Autofill subject line in appointment from options selected in combobox Using Outlook 6
J Create an appointment from Contact list with the Company name in the Subject line Using Outlook 1
M Create an Appointment from XL Spreadsheet in a Shared Calendar. Outlook VBA and Custom Forms 1
Similar threads


















































Top