Outlook Object Model returns new id of public folder items


M

Manuel M.

Hello,

I have a strange behavior when retrieving items from public folders.

I use Java and Comfyj to connect to Outlook. It uses the Outlook
Object Model.
What I have done so far.

1) Connecting to Outlook and retrieving all folder and items in a
folder.
2) Saving the EntryID and StoreID of the items (mails, tasks, etc.)
3) Trying to display an item that is NOT in a public folder works
always!
4) Trying to display an item that IS in a public folder works
sporadic. Displaying the item directly after saving the EntryID and
StoreID works. Calling the item after 2 hours did not work. When I
save the item again it has a different EntryID but the StoreID is the
same.
Same problem if i kill the outlook.exe process and trying to display
the item again (is faster than waiting 2 hours).

The items were not modified or moved.

Windows XP SP3 with Outlook 2007 SP 2 and Exchange 2003.
Same behavior with Exchange-Cache-Mode activated and deactivated.

Example of the different EntryIDs:

1. save:
EF0000005E20C936D0B94958BCFB3349E23E1780080001000000010000000000B469010000000000CDC9

2. save:
EF0000005E20C936D0B94958BCFB3349E23E1780080006000000010000000000B469010000000000CDC9

On the 26th position they differ: 1 in the first and 6 in the seccone
EntryID.

If I wait again 2 hours or forcing the error then the ID is again the
first one.

I stuck on this and I am absolutely confused. Is this a internal
Outlook session behavior or what could this be?
Before I forget it. The Outlook connection is always done with the
same user, password (profile). Also calling the item to display.

Any help or ideas are appreciated.

Thank you,
manuel
 
Ad

Advertisements

M

Manuel M.

Got it.

I have to get the long term EntryID that is provided by Exchange.

Code for Java:

_TaskItem t = TaskItem.queryInterface(outlookItem);
_PropertyAccessor pa = t.getPropertyAccessor();
if (null != pa && !pa.isNull()) {
try {
// PR_LONGTERM_ENTRYID_FROM_TABLE
uid = pa.binaryToString(pa.getProperty(new BStr("http://
schemas.microsoft.com/mapi/proptag/0x66700102"))).getValue();
} catch (Exception e) {
// PR_ENTRY_ID
uid = pa.binaryToString(pa.getProperty(new BStr("http://
schemas.microsoft.com/mapi/proptag/0x0FFF0102"))).getValue();
}
}
 
K

Ken Slovak - [MVP - Outlook]

A short term ID is valid only for that Outlook session, that 2 hours sounds
odd. If the same session was running the short-term EntryID should still
have been valid.

Also, Outlook always returns the long-term id when you retrieve the EntryID.
Were you using the Outlook object model to retrieve the EntryID and StoreID?
 
M

Manuel M.

Thank you for your comment.
As I described in my first post I am using Java with ComfyJ. And the
program is
running on a single client pc. All other pc's are "behaving normal".

I think the problem is in the generated classes from ComfyJ. With it I
generated
Java classes to use the Outlook object model. I tried getting the
EntryID from
a MailItem object with the generated classes. It always returns a
Outlook session
EntryID which has a length of 85 signs. Getting the EntryID with the
PropertyAccessor
class returns an EntryID which has a length of 141 signs.
Comparing the EntryIDs results in true.

Thank you,
Manuel
 
K

Ken Slovak - [MVP - Outlook]

Then what you're getting is the short-term EntryID, not the long-term
EntryID. Which is very surprising because use of the Outlook object model
returns the long-term EntryID. so your language must be doing something
weird and there's nothing anyone can do about it other than using a
different language.




Thank you for your comment.
As I described in my first post I am using Java with ComfyJ. And the
program is
running on a single client pc. All other pc's are "behaving normal".

I think the problem is in the generated classes from ComfyJ. With it I
generated
Java classes to use the Outlook object model. I tried getting the
EntryID from
a MailItem object with the generated classes. It always returns a
Outlook session
EntryID which has a length of 85 signs. Getting the EntryID with the
PropertyAccessor
class returns an EntryID which has a length of 141 signs.
Comparing the EntryIDs results in true.

Thank you,
Manuel
 
M

Manuel M.

My second post is the solution when using Outlook 2007.
With the PropertyAccessor I am able to get the PR_ENTRY_ID that is
permanent and
not from the Outlook session.
So everything is fine.
In Outlook 2003 there is no PropertyAccessor class that I can use. But
there is no
such problem under Outlook 2003.

But thanks anyway :)

Manuel
 
Ad

Advertisements

K

Kevin German

How do I convert the byte[] value that is returned by the following statement into a valid EntryId string?

(byte[])row["http://schemas.microsoft.com/mapi/proptag/0x66700102"]

row, being an Outlook.Row object...



Manuel M. wrote:

My second post is the solution when using Outlook 2007.
18-Jan-10

My second post is the solution when using Outlook 2007
With the PropertyAccessor I am able to get the PR_ENTRY_ID that i
permanent an
not from the Outlook session
So everything is fine
In Outlook 2003 there is no PropertyAccessor class that I can use. Bu
there is n
such problem under Outlook 2003

But thanks anyway :-

Manue

On 18 Jan., 15:51, "Ken Slovak - [MVP - Outlook]" <[email protected]
wrote:

Previous Posts In This Thread:

Outlook Object Model returns new id of public folder items
Hello

I have a strange behavior when retrieving items from public folders

I use Java and Comfyj to connect to Outlook. It uses the Outloo
Object Model
What I have done so far

1) Connecting to Outlook and retrieving all folder and items in
folder
2) Saving the EntryID and StoreID of the items (mails, tasks, etc.
3) Trying to display an item that is NOT in a public folder work
always
4) Trying to display an item that IS in a public folder work
sporadic. Displaying the item directly after saving the EntryID an
StoreID works. Calling the item after 2 hours did not work. When
save the item again it has a different EntryID but the StoreID is th
same
Same problem if i kill the outlook.exe process and trying to displa
the item again (is faster than waiting 2 hours)

The items were not modified or moved

Windows XP SP3 with Outlook 2007 SP 2 and Exchange 2003
Same behavior with Exchange-Cache-Mode activated and deactivated

Example of the different EntryIDs

1. save
EF0000005E20C936D0B94958BCFB3349E23E1780080001000000010000000000B469010000000000CDC

2. save
EF0000005E20C936D0B94958BCFB3349E23E1780080006000000010000000000B469010000000000CDC

On the 26th position they differ: 1 in the first and 6 in the seccon
EntryID

If I wait again 2 hours or forcing the error then the ID is again th
first one

I stuck on this and I am absolutely confused. Is this a interna
Outlook session behavior or what could this be
Before I forget it. The Outlook connection is always done with th
same user, password (profile). Also calling the item to display

Any help or ideas are appreciated

Thank you
manuel

Got it.I have to get the long term EntryID that is provided by Exchange.
Got it

I have to get the long term EntryID that is provided by Exchange

Code for Java

_TaskItem t = TaskItem.queryInterface(outlookItem)
_PropertyAccessor pa = t.getPropertyAccessor()
if (null != pa && !pa.isNull())
try
// PR_LONGTERM_ENTRYID_FROM_TABL
uid = pa.binaryToString(pa.getProperty(new BStr("http:/
schemas.microsoft.com/mapi/proptag/0x66700102"))).getValue()
} catch (Exception e)
// PR_ENTRY_I
uid = pa.binaryToString(pa.getProperty(new BStr("http:/
schemas.microsoft.com/mapi/proptag/0x0FFF0102"))).getValue()



wrote:

A short term ID is valid only for that Outlook session, that 2 hours soundsodd.
A short term ID is valid only for that Outlook session, that 2 hours sound
odd. If the same session was running the short-term EntryID should stil
have been valid

Also, Outlook always returns the long-term id when you retrieve the EntryID
Were you using the Outlook object model to retrieve the EntryID and StoreID

-
Ken Slova
[MVP - Outlook
http://www.slovaktech.co
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

Thank you for your comment.
Thank you for your comment
As I described in my first post I am using Java with ComfyJ. And th
program i
running on a single client pc. All other pc's are "behaving normal".

I think the problem is in the generated classes from ComfyJ. With it I
generated
Java classes to use the Outlook object model. I tried getting the
EntryID from
a MailItem object with the generated classes. It always returns a
Outlook session
EntryID which has a length of 85 signs. Getting the EntryID with the
PropertyAccessor
class returns an EntryID which has a length of 141 signs.
Comparing the EntryIDs results in true.

Thank you,
Manuel


On 15 Jan., 15:28, "Ken Slovak - [MVP - Outlook]" <[email protected]>
wrote:
ds
ID.
ID?
ktech.com/products.htm
tr("http://
tr("http://
0000000000CDC9

Then what you are getting is the short-term EntryID, not the long-termEntryID.
Then what you are getting is the short-term EntryID, not the long-term
EntryID. Which is very surprising because use of the Outlook object model
returns the long-term EntryID. so your language must be doing something
weird and there is nothing anyone can do about it other than using a
different language.




Thank you for your comment.
As I described in my first post I am using Java with ComfyJ. And the
program is
running on a single client pc. All other pc's are "behaving normal".

I think the problem is in the generated classes from ComfyJ. With it I
generated
Java classes to use the Outlook object model. I tried getting the
EntryID from
a MailItem object with the generated classes. It always returns a
Outlook session
EntryID which has a length of 85 signs. Getting the EntryID with the
PropertyAccessor
class returns an EntryID which has a length of 141 signs.
Comparing the EntryIDs results in true.

Thank you,
Manuel

My second post is the solution when using Outlook 2007.
My second post is the solution when using Outlook 2007.
With the PropertyAccessor I am able to get the PR_ENTRY_ID that is
permanent and
not from the Outlook session.
So everything is fine.
In Outlook 2003 there is no PropertyAccessor class that I can use. But
there is no
such problem under Outlook 2003.

But thanks anyway :)

Manuel


On 18 Jan., 15:51, "Ken Slovak - [MVP - Outlook]" <[email protected]>
wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Putting Twitter Realtime Search to Work
http://www.eggheadcafe.com/tutorials/aspnet/6100d85b-2f27-472d-af24-c9960b55b669/putting-twitter-realtime.aspx
 
K

Kevin German

Nevermind. Figured out the values in the byte array were decimal values that needed to be converted to hexadecimal to come up with the EntryID. Here is what I did.

foreach (byte decByte in decBytes)
{
string hexValue = ((int)decByte).ToString("X");
entryID += (hexValue.Length == 1 ? "0" + hexValue : hexValue);
}

Let me know if anyone has a better way of doing this...



Kevin German wrote:

Long-term EntryID
12-Feb-10

How do I convert the byte[] value that is returned by the following statement into a valid EntryId string?

(byte[])row["http://schemas.microsoft.com/mapi/proptag/0x66700102"]

row, being an Outlook.Row object...

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Custom Validation Using the Enterprise Library
http://www.eggheadcafe.com/tutorials/aspnet/9af7ac1a-d7f3-4e00-9aec-33ef1ec7d1a3/wpf-custom-validation-usi.aspx
 
Ad

Advertisements

B

Brian Tillman [MVP-Outlook]

Nevermind. Figured out the values in the byte array were decimal values
that needed to be converted
to hexadecimal to come up with the EntryID. Here is what I did.
Please post programming questions in microsoft.public.outlook.program_vba.
 

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