Difference between StoreIDs in Outlook 2007 and 2003

L

Len Grout

When getting the StoreID from the same Contact Item in Outlook 2007
and Outlook 2003 the StoreIDs are different in length. This becomes a
problem when trying to support both Outlook 2007 and 2003 in an
outlook addin.
Example of the StoreID for a local Outlook contact in 2007
0000000038A1BB1005E5101AA1BB08002B2A56C20000454D534D444
22E444C4C00000000000000001B55FA20AA6611CD9BC800AA002FC4
5A0C00000045584348414E4745444556002F6F3D437947656E4578636
8616E6765446576656C6F706D656E742F6F753D46697273742041646D
696E6973747261746976652047726F75702F636E3D526563697069656E
74732F636E3D4C656E00

Example of the StoreID for the same Local Outlook contact in 2003
0000000038A1BB1005E5101AA1BB08002B2A56C20000454D534D444
22E444C4C00000000000000001B55FA20AA6611CD9BC800AA002FC4
5A0C00000045584348414E4745444556002F6F3D437947656E4578636
8616E6765446576656C6F706D656E742F6F753D46697273742041646D
696E6973747261746976652047726F75702F636E3D526563697069656E
74732F636E3D4C656E00D83521F3B7000000010000001400000079000
0002F6F3D437947656E45786368616E6765446576656C6F706D656E74
2F6F753D46697273742041646D696E6973747261746976652047726F7
5702F636E3D436F6E66696775726174696F6E2F636E3D5365727665727
32F636E3D45584348414E474544455600650078006300680061006E00
670065006400650076002E004400650076002E0043007900470065006E
0054006500630068002E0063006F006D0000000000

The same kind of thing is true for the StoreID of a Contact in a
public Store, and for any Outlook item like Appointment, Email, etc.

Is there a way in the Outlook 2007 Object Model to get the StoreID
that is the same as in Outlook 2003?
What is the reason for the change in how Outlook 2007 shortens the
StoreID?

Thank you
len
 
L

Len Grout

I noticed that as reported by Outlook spy in Office 2007 that the
lengths for the storeID varied between items that were in a public
folder and items that were local to my outlook. Items in the public
store have a storeID that was 144 characters long and Items in my
local folders have storeID's that are 302 characters long. Both of
these storeID's are significantly shorter than the storeID's reported
for public or local items in outlook 2003. These values hold true for
my test environment. WIll the length of storeID's for public folder
items always be 144 and for local items always be 302 in Office 2007?
Do the length of those values vary based on the exchange environment?
Is there a way to reliably truncate the length of the storeID as
reported by office 2003 to a value that will work in 2007?

Thanks,
Len
 
J

Jialiang Ge [MSFT]

Hello Len,

I have reproduced the issue with the VBA code:
Dim myNamespace As Outlook.NameSpace
' Dim myContacts As Outlook.Folder
Dim myItem1 As Outlook.ContactItem

Set myNamespace = Application.GetNamespace("MAPI")
Set myContacts = myNamespace.GetDefaultFolder(olFolderContacts)
Set myItem1 = myContacts.Items.Find("[FirstName] = ""Daokuan""")

MsgBox myItem1.Parent.StoreID

run on Outlook 2003 and Outlook 2007 respectively.

I think the difference is introduced by a change of StoreID calculation
algorithm in Outlook 2007. The StoreID is a hash calculation result.
See the new algorithm at: "Algorithm to calculate the store hash"
http://blogs.msdn.com/stephen_griffin/archive/2006/05/10/outlook-2007-beta-d
ocumentation-notification-based-indexing-support.aspx

I am asking the product team for more information about it, and see what is
the most reliable way to compare/truncate the StoreIDs. I will get back to
you as soon as possible. Thank you for your patience.

Regards,
Jialiang Ge ([email protected], remove ¡®online.¡¯)
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box ¡°Tools/Options/Read: Get 300 headers at a time¡±
to see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided ¡°AS IS¡± with no warranties, and confers no
rights.
 
K

Ken Slovak - [MVP - Outlook]

There is no guarantee of any length for a StoreID (or an EntryID).

Using test code I read StoreID from the same mailbox on Outlook 2003 and
Outlook 2007. The StoreID's returned were of different lengths, as you
mention.

However, using NameSpace.GetItemFromID using an item EntryID and either of
the 2 StoreID's returned the same contact item. So it didn't matter what the
specific length of the StoreID used, as long as it met with the minimum
specifications for a StoreID.

Retrieving the item with either StoreID worked in both Outlook 2003 and
2007.

Using Outlook 2007's NameSpace.CompareEntryIDs() with both StoreID's returns
true, therefore indicating that Outlook considers the different StoreID's to
be effectively the same.

The same type of thing can occur with Exchange and EntryID, you can get
either the short-term ID or the long-term ID. The short-term ID is only
valid for that Outlook session and is much shorter than the long-term ID but
if you compare them using CompareEntryIDs() the return value is true.

So, are you having a problem?
 
J

Jialiang Ge [MSFT]

Hello Len,

As Ken said, the product team also responsed that we do not need to
truncate the StoreID. We can use CompareEntryIDs to compare them with
different length. It is not based on the Exchange environment. If you have
any other concerns or need anything else, please feel free to let us know.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hi Len,

Would you mind letting me know the result of the suggestions? If you need
further assistance, feel free to let me know. I will be more than happy to
be of assistance.

Have a great day!

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
L

Len Grout

Hi Jialiang,
I was more looking for the reason for the difference between the two
Outlook versions.
I appreciate the responses from you and Ken, they have been
informative.

thanks for your help,

Len
 
J

Jialiang Ge [MSFT]

Hello Len,

The reason for the difference is the new algorithm to encode the Entry ID
or StoreID. (See LPWSTR EncodeID(ULONG cbEID, LPENTRYID rgbID) in
http://blogs.msdn.com/stephen_griffin/archive/2006/05/10/outlook-2007-beta-d
ocumentation-notification-based-indexing-support.aspx). The goal of this
algorithm is to generate a compact representation of the Entry and Store ID.

If you have any other questions or concerns, feel free to let us know.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top