.restrict results changing after moving to Exchange online

allanreese

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hi


After running our own Exchange server 2010 we have migrated to Exchange online. I have quite a lot of VBA code which I sill need:)

Somehow when I use the .restrict method on date fileds in contact form i don't get the same results than when running against our Exchange server 2010. I do the testing with the same Outlook 2016 (32bit) client. The code in question could be this:

Code:
    Dim objNameSpace As NameSpace
    Dim objContactFolder
    Dim objContacts
    Dim objContact As Outlook.ContactItem
    Dim strMedlemNr
    Dim counter
    Dim date_to_search As Date

    Set objNameSpace = Application.GetNamespace("MAPI")
    Set objContactFolder = GetPublicFolder(SpellFavorites & "\SPF\Spillere")
    Set objContacts = objContactFolder.Items
    
    date_to_search = #3/19/2005# '5. March 2019
    s_date = "[Birthday] = '" & date_to_search & "'"
    
    Set objContactRestricted = objContacts.Restrict(s_date)

    MsgBox objContactRestricted.Count
When running against Exchange 2010 I get 1 hit and when running against Exchange online I doesn't get hits at all. Folder content on the 2 servers are identical.

Looking into the folder with MFCMAPI I can look this item up:

Code:
    <property tag = "0x3A420040" type = "PT_SYSTIME">
        <ExactNames>PR_BIRTHDAY, PidTagBirthday</ExactNames>
        <Value>11:59:00 19-03-05</Value>
        <AltValue>Low: 0x0962DA00 High: 0x01C52C7B</AltValue>
    </property>
Should prove me one hit:)

I don't have any problems with using restrict on text values.

Anybody who knows why .restrict is performing otherwise on Exchange online compared to Exchange 2010?

- Allan
 
Top