Home All Groups Group Topic Archive Search About

Identify store/folder uniquely

Author
12 Apr 2005 10:46 PM
Oleg Ogurok
Hi all,

I need to ensure each time my application runs, it opens one Contacts folder
and performs operations on it.

       MAPI.Folder myFolder = (MAPI.Folder)session.GetFolder(folderID,
storeID);

However, every time I open a session and iterate through stores via
session.InfoStores, the same store has a different ID (store.ID). What's
interesting is the fact that the IDs seem to look alike, e.g.

"FF00000038A1BB1005E5101AA1BB08002B2A56C200018E76EA38F2152D40822DFCB17DA4875
6"
"FF00000038A1BB1005E5101AA1BB08002B2A56C200010AC217A5E4267241979283ACD0CD06F
A"
"FF00000038A1BB1005E5101AA1BB08002B2A56C20001CFCDAD7924D7B347A9CCDF7ACB920CB
F"

These are the IDs of the same store when I run my application 3 times in a
row.

What's the best way to accomplish my objective? How can I be sure to open
the right folder each time?

Thanks,

-Oleg.

Author
13 Apr 2005 5:45 AM
Iv Borissov
Oleg,
mostly likely you get short-term entry ids (ID) which can
only be used in the current sesstion. Open the object using its short term
entry id first and read ID from the object itself

Show quote
"Oleg Ogurok" <oleg@ogurok.ireallyhatespammers.com> wrote in message
news:QbY6e.62674$NC6.27137@newsread1.mlpsca01.us.to.verio.net...
> Hi all,
>
> I need to ensure each time my application runs, it opens one Contacts
folder
> and performs operations on it.
>
>        MAPI.Folder myFolder = (MAPI.Folder)session.GetFolder(folderID,
> storeID);
>
> However, every time I open a session and iterate through stores via
> session.InfoStores, the same store has a different ID (store.ID). What's
> interesting is the fact that the IDs seem to look alike, e.g.
>
>
"FF00000038A1BB1005E5101AA1BB08002B2A56C200018E76EA38F2152D40822DFCB17DA4875
> 6"
>
"FF00000038A1BB1005E5101AA1BB08002B2A56C200010AC217A5E4267241979283ACD0CD06F
> A"
>
"FF00000038A1BB1005E5101AA1BB08002B2A56C20001CFCDAD7924D7B347A9CCDF7ACB920CB
> F"
>
> These are the IDs of the same store when I run my application 3 times in a
> row.
>
> What's the best way to accomplish my objective? How can I be sure to open
> the right folder each time?
>
> Thanks,
>
> -Oleg.
>
>
Author
13 Apr 2005 7:47 AM
Vincent Daron
Reading this discussion ... sorry for intrusion ..

What's a "short therm entry id" ? can you give more explications please ?


Iv Borissov wrote:
Show quote
> Oleg,
>  mostly likely you get short-term entry ids (ID) which can
>  only be used in the current sesstion. Open the object using its short term
>  entry id first and read ID from the object itself
>
> "Oleg Ogurok" <oleg@ogurok.ireallyhatespammers.com> wrote in message
> news:QbY6e.62674$NC6.27137@newsread1.mlpsca01.us.to.verio.net...
>
>>Hi all,
>>
>>I need to ensure each time my application runs, it opens one Contacts
>
> folder
>
>>and performs operations on it.
>>
>>       MAPI.Folder myFolder = (MAPI.Folder)session.GetFolder(folderID,
>>storeID);
>>
>>However, every time I open a session and iterate through stores via
>>session.InfoStores, the same store has a different ID (store.ID). What's
>>interesting is the fact that the IDs seem to look alike, e.g.
>>
>>
>
> "FF00000038A1BB1005E5101AA1BB08002B2A56C200018E76EA38F2152D40822DFCB17DA4875
>
>>6"
>>
>
> "FF00000038A1BB1005E5101AA1BB08002B2A56C200010AC217A5E4267241979283ACD0CD06F
>
>>A"
>>
>
> "FF00000038A1BB1005E5101AA1BB08002B2A56C20001CFCDAD7924D7B347A9CCDF7ACB920CB
>
>>F"
>>
>>These are the IDs of the same store when I run my application 3 times in a
>>row.
>>
>>What's the best way to accomplish my objective? How can I be sure to open
>>the right folder each time?
>>
>>Thanks,
>>
>>-Oleg.
>>
>>
>
>
>
Author
13 Apr 2005 9:53 AM
Iv Borissov
From MSDN:

=======================================
When a client accesses an entry identifier through a column in a table, most
likely this entry identifier is short-term rather than long-term. Short-term
entry identifiers can be used to open their corresponding objects only in
the current MAPI session.



Entry identifiers come in two types: short-term and long-term. Short-term
entry identifiers are faster to construct, but their uniqueness is
guaranteed only over the life of the current session on the current
workstation. Long-term entry identifiers have a more prolonged lifespan.
Short-term entry identifiers are used primarily for rows in tables and
entries in dialog boxes whereas long-term entry identifiers are used for
many objects such as messages, folders, and distribution lists.

=======================================

Because Session.InfoStores wraps IMAPITable nterface, all EntryID (ID) in
this table are short-term (valid inside This MAPI session).



Ref:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/9598fb31-6141-4cc6-b8dc-4491c2d86900.asp



and



http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/e76663ff-5119-4ecc-987e-c41ff7580437.asp







Show quote
"Vincent Daron" <trop***@tiscali.be> wrote in message
news:eazfB0$PFHA.3628@TK2MSFTNGP15.phx.gbl...
> Reading this discussion ... sorry for intrusion ..
>
> What's a "short therm entry id" ? can you give more explications please ?
>
>
> Iv Borissov wrote:
> > Oleg,
> >  mostly likely you get short-term entry ids (ID) which can
> >  only be used in the current sesstion. Open the object using its short
term
> >  entry id first and read ID from the object itself
> >
> > "Oleg Ogurok" <oleg@ogurok.ireallyhatespammers.com> wrote in message
> > news:QbY6e.62674$NC6.27137@newsread1.mlpsca01.us.to.verio.net...
> >
> >>Hi all,
> >>
> >>I need to ensure each time my application runs, it opens one Contacts
> >
> > folder
> >
> >>and performs operations on it.
> >>
> >>       MAPI.Folder myFolder = (MAPI.Folder)session.GetFolder(folderID,
> >>storeID);
> >>
> >>However, every time I open a session and iterate through stores via
> >>session.InfoStores, the same store has a different ID (store.ID). What's
> >>interesting is the fact that the IDs seem to look alike, e.g.
> >>
> >>
> >
> >
"FF00000038A1BB1005E5101AA1BB08002B2A56C200018E76EA38F2152D40822DFCB17DA4875
> >
> >>6"
> >>
> >
> >
"FF00000038A1BB1005E5101AA1BB08002B2A56C200010AC217A5E4267241979283ACD0CD06F
> >
> >>A"
> >>
> >
> >
"FF00000038A1BB1005E5101AA1BB08002B2A56C20001CFCDAD7924D7B347A9CCDF7ACB920CB
> >
> >>F"
> >>
> >>These are the IDs of the same store when I run my application 3 times in
a
> >>row.
> >>
> >>What's the best way to accomplish my objective? How can I be sure to
open
> >>the right folder each time?
> >>
> >>Thanks,
> >>
> >>-Oleg.
> >>
> >>
> >
> >
> >
Author
13 Apr 2005 12:45 PM
Oleg Ogurok
So, is there a way to get a long term entry ID?
If not, in what format do I store the path to the folder so that I could
open the folder each time my program runs?
Do I have to iterate through all stores/folders? This just seems
inefficient.
Thanks.

-Oleg.

Show quote
"Iv Borissov" <wrongaddr***@discussions.microsoft.com> wrote in message
news:O4G8k6AQFHA.1476@TK2MSFTNGP09.phx.gbl...
> From MSDN:
>
> =======================================
> When a client accesses an entry identifier through a column in a table,
most
> likely this entry identifier is short-term rather than long-term.
Short-term
> entry identifiers can be used to open their corresponding objects only in
> the current MAPI session.
>
>
>
> Entry identifiers come in two types: short-term and long-term. Short-term
> entry identifiers are faster to construct, but their uniqueness is
> guaranteed only over the life of the current session on the current
> workstation. Long-term entry identifiers have a more prolonged lifespan.
> Short-term entry identifiers are used primarily for rows in tables and
> entries in dialog boxes whereas long-term entry identifiers are used for
> many objects such as messages, folders, and distribution lists.
>
> =======================================
>
> Because Session.InfoStores wraps IMAPITable nterface, all EntryID (ID) in
> this table are short-term (valid inside This MAPI session).
>
>
>
> Ref:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/9598fb31-6141-4cc6-b8dc-4491c2d86900.asp
>
>
>
> and
>
>
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/e76663ff-5119-4ecc-987e-c41ff7580437.asp
Show quote
>
>
>
>
>
>
>
> "Vincent Daron" <trop***@tiscali.be> wrote in message
> news:eazfB0$PFHA.3628@TK2MSFTNGP15.phx.gbl...
> > Reading this discussion ... sorry for intrusion ..
> >
> > What's a "short therm entry id" ? can you give more explications please
?
> >
> >
> > Iv Borissov wrote:
> > > Oleg,
> > >  mostly likely you get short-term entry ids (ID) which can
> > >  only be used in the current sesstion. Open the object using its short
> term
> > >  entry id first and read ID from the object itself
> > >
> > > "Oleg Ogurok" <oleg@ogurok.ireallyhatespammers.com> wrote in message
> > > news:QbY6e.62674$NC6.27137@newsread1.mlpsca01.us.to.verio.net...
> > >
> > >>Hi all,
> > >>
> > >>I need to ensure each time my application runs, it opens one Contacts
> > >
> > > folder
> > >
> > >>and performs operations on it.
> > >>
> > >>       MAPI.Folder myFolder = (MAPI.Folder)session.GetFolder(folderID,
> > >>storeID);
> > >>
> > >>However, every time I open a session and iterate through stores via
> > >>session.InfoStores, the same store has a different ID (store.ID).
What's
> > >>interesting is the fact that the IDs seem to look alike, e.g.
> > >>
> > >>
> > >
> > >
>
"FF00000038A1BB1005E5101AA1BB08002B2A56C200018E76EA38F2152D40822DFCB17DA4875
> > >
> > >>6"
> > >>
> > >
> > >
>
"FF00000038A1BB1005E5101AA1BB08002B2A56C200010AC217A5E4267241979283ACD0CD06F
> > >
> > >>A"
> > >>
> > >
> > >
>
"FF00000038A1BB1005E5101AA1BB08002B2A56C20001CFCDAD7924D7B347A9CCDF7ACB920CB
> > >
> > >>F"
> > >>
> > >>These are the IDs of the same store when I run my application 3 times
in
> a
> > >>row.
> > >>
> > >>What's the best way to accomplish my objective? How can I be sure to
> open
> > >>the right folder each time?
> > >>
> > >>Thanks,
> > >>
> > >>-Oleg.
> > >>
> > >>
> > >
> > >
> > >
>
>
Author
13 Apr 2005 12:57 PM
Ken Slovak - [MVP - Outlook]
StoreID should always be the same. EntryID is what is short-term or
long-term and that only applies with Exchange. With a PST file the EntryID
is always the long-term one.

The property tags for short-term and long-term IDs' are:

PR_ENTRYID = 0xFFF0102
PR_LONGTERM_ENTRYID_FROM_TABLE = 0x66700102

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


Show quote
"Oleg Ogurok" <oleg@ogurok.ireallyhatespammers.com> wrote in message
news:Bu87e.62694$NC6.11314@newsread1.mlpsca01.us.to.verio.net...
>
> So, is there a way to get a long term entry ID?
> If not, in what format do I store the path to the folder so that I could
> open the folder each time my program runs?
> Do I have to iterate through all stores/folders? This just seems
> inefficient.
> Thanks.
>
> -Oleg.
Author
13 Apr 2005 8:21 PM
Oleg Ogurok
Found it, I just needed to read the CdoPR_STORE_ENTRYID (&H0FFB0102) field.

-Oleg.

Show quote
"Oleg Ogurok" <oleg@ogurok.ireallyhatespammers.com> wrote in message
news:Bu87e.62694$NC6.11314@newsread1.mlpsca01.us.to.verio.net...
>
> So, is there a way to get a long term entry ID?
> If not, in what format do I store the path to the folder so that I could
> open the folder each time my program runs?
> Do I have to iterate through all stores/folders? This just seems
> inefficient.
> Thanks.
>
> -Oleg.
>
> "Iv Borissov" <wrongaddr***@discussions.microsoft.com> wrote in message
> news:O4G8k6AQFHA.1476@TK2MSFTNGP09.phx.gbl...
> > From MSDN:
> >
> > =======================================
> > When a client accesses an entry identifier through a column in a table,
> most
> > likely this entry identifier is short-term rather than long-term.
> Short-term
> > entry identifiers can be used to open their corresponding objects only
in
> > the current MAPI session.
> >
> >
> >
> > Entry identifiers come in two types: short-term and long-term.
Short-term
> > entry identifiers are faster to construct, but their uniqueness is
> > guaranteed only over the life of the current session on the current
> > workstation. Long-term entry identifiers have a more prolonged lifespan.
> > Short-term entry identifiers are used primarily for rows in tables and
> > entries in dialog boxes whereas long-term entry identifiers are used for
> > many objects such as messages, folders, and distribution lists.
> >
> > =======================================
> >
> > Because Session.InfoStores wraps IMAPITable nterface, all EntryID (ID)
in
> > this table are short-term (valid inside This MAPI session).
> >
> >
> >
> > Ref:
> >
> >
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/9598fb31-6141-4cc6-b8dc-4491c2d86900.asp
> >
> >
> >
> > and
> >
> >
> >
> >
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/e76663ff-5119-4ecc-987e-c41ff7580437.asp
Show quote
> >
> >
> >
> >
> >
> >
> >
> > "Vincent Daron" <trop***@tiscali.be> wrote in message
> > news:eazfB0$PFHA.3628@TK2MSFTNGP15.phx.gbl...
> > > Reading this discussion ... sorry for intrusion ..
> > >
> > > What's a "short therm entry id" ? can you give more explications
please
> ?
> > >
> > >
> > > Iv Borissov wrote:
> > > > Oleg,
> > > >  mostly likely you get short-term entry ids (ID) which can
> > > >  only be used in the current sesstion. Open the object using its
short
> > term
> > > >  entry id first and read ID from the object itself
> > > >
> > > > "Oleg Ogurok" <oleg@ogurok.ireallyhatespammers.com> wrote in message
> > > > news:QbY6e.62674$NC6.27137@newsread1.mlpsca01.us.to.verio.net...
> > > >
> > > >>Hi all,
> > > >>
> > > >>I need to ensure each time my application runs, it opens one
Contacts
> > > >
> > > > folder
> > > >
> > > >>and performs operations on it.
> > > >>
> > > >>       MAPI.Folder myFolder =
(MAPI.Folder)session.GetFolder(folderID,
Show quote
> > > >>storeID);
> > > >>
> > > >>However, every time I open a session and iterate through stores via
> > > >>session.InfoStores, the same store has a different ID (store.ID).
> What's
> > > >>interesting is the fact that the IDs seem to look alike, e.g.
> > > >>
> > > >>
> > > >
> > > >
> >
>
"FF00000038A1BB1005E5101AA1BB08002B2A56C200018E76EA38F2152D40822DFCB17DA4875
> > > >
> > > >>6"
> > > >>
> > > >
> > > >
> >
>
"FF00000038A1BB1005E5101AA1BB08002B2A56C200010AC217A5E4267241979283ACD0CD06F
> > > >
> > > >>A"
> > > >>
> > > >
> > > >
> >
>
"FF00000038A1BB1005E5101AA1BB08002B2A56C20001CFCDAD7924D7B347A9CCDF7ACB920CB
> > > >
> > > >>F"
> > > >>
> > > >>These are the IDs of the same store when I run my application 3
times
> in
> > a
> > > >>row.
> > > >>
> > > >>What's the best way to accomplish my objective? How can I be sure to
> > open
> > > >>the right folder each time?
> > > >>
> > > >>Thanks,
> > > >>
> > > >>-Oleg.
> > > >>
> > > >>
> > > >
> > > >
> > > >
> >
> >
>
>

AddThis Social Bookmark Button