Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: How to use GetIDsFromNames(....) method ?

Geek News

How to use GetIDsFromNames(....) method ?
"Wassim Dagash" <wassim.dagash[ at ]gmail.com> 1/8/2007 2:46:26 PM
Im trying to use the method GetIDsFromNames (C#) but I dont know what
each parameter is for:

int GetIDsFromNames(object MAPIProp, string GUID, object ID, bool
bCreate)

I know waht are GUID and ID but I dont know what the other two
parameters are, Can anyone please help me?

Re: How to use GetIDsFromNames(....) method ?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 1/8/2007 4:57:28 PM
Is that for Redemption (looks like it judging from the method signature)?
The first parameter is the object (such as MailItem from the Outlook Object
Model). The last parameter allows you to specify whether the mapping must be
created if it's never been used before for the given message store.
E.g. if you specify false, you will get back 0 if the particular combination
of GUID/id has never been used. In most cases, you need to pass true.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
news:1168267586.253223.301500[ at ]38g2000cwa.googlegroups.com...
[Quoted Text]
> Im trying to use the method GetIDsFromNames (C#) but I dont know what
> each parameter is for:
>
> int GetIDsFromNames(object MAPIProp, string GUID, object ID, bool
> bCreate)
>
> I know waht are GUID and ID but I dont know what the other two
> parameters are, Can anyone please help me?
>


Re: How to use GetIDsFromNames(....) method ?
"Wassim Dagash" <wassim.dagash[ at ]gmail.com> 1/8/2007 5:56:21 PM
Hello Dmitry,
Im trying to use redemption in order to build a ristrict on the
items of outlook calendar.The restriction is simple: getting all
meeting in a range. I tried to use PR_START_DATE and PR_END_DATE
properties for ulPropTag but it seems like not all appointments in OL
calendar got these two properties ( compare by outlook spy), therfore I
tried to use "start" and "end" named properties as ulPropTag , but it
failed cause the name properies should be converted . Im trying to use
GetIDsFromNames inorder to get this convertion. In that case I think
I've some kind of "deadlock" : Im trying to use GetIDsFromNames
inorder to get the item and the function needs the item as parameter.
Do you have any idea how could solve this issue? I'll appreciate your
help.

Dmitry Streblechenko wrote:
[Quoted Text]
> Is that for Redemption (looks like it judging from the method signature)?
> The first parameter is the object (such as MailItem from the Outlook Object
> Model). The last parameter allows you to specify whether the mapping must be
> created if it's never been used before for the given message store.
> E.g. if you specify false, you will get back 0 if the particular combination
> of GUID/id has never been used. In most cases, you need to pass true.
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
> news:1168267586.253223.301500[ at ]38g2000cwa.googlegroups.com...
> > Im trying to use the method GetIDsFromNames (C#) but I dont know what
> > each parameter is for:
> >
> > int GetIDsFromNames(object MAPIProp, string GUID, object ID, bool
> > bCreate)
> >
> > I know waht are GUID and ID but I dont know what the other two
> > parameters are, Can anyone please help me?
> >

Re: How to use GetIDsFromNames(....) method ?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 1/8/2007 6:18:38 PM
You can check that Items.Count > 0 (otherwise there is no point using a
Restriction) and pass the very first item from the folder. Or you can pass
the folder itself - all Redemption cares about is that the object passed as
the first parameter implements a MAPIOBJECT property.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
news:1168278981.157304.265170[ at ]s34g2000cwa.googlegroups.com...
[Quoted Text]
> Hello Dmitry,
> Im trying to use redemption in order to build a ristrict on the
> items of outlook calendar.The restriction is simple: getting all
> meeting in a range. I tried to use PR_START_DATE and PR_END_DATE
> properties for ulPropTag but it seems like not all appointments in OL
> calendar got these two properties ( compare by outlook spy), therfore I
> tried to use "start" and "end" named properties as ulPropTag , but it
> failed cause the name properies should be converted . Im trying to use
> GetIDsFromNames inorder to get this convertion. In that case I think
> I've some kind of "deadlock" : Im trying to use GetIDsFromNames
> inorder to get the item and the function needs the item as parameter.
> Do you have any idea how could solve this issue? I'll appreciate your
> help.
>
> Dmitry Streblechenko wrote:
>> Is that for Redemption (looks like it judging from the method signature)?
>> The first parameter is the object (such as MailItem from the Outlook
>> Object
>> Model). The last parameter allows you to specify whether the mapping must
>> be
>> created if it's never been used before for the given message store.
>> E.g. if you specify false, you will get back 0 if the particular
>> combination
>> of GUID/id has never been used. In most cases, you need to pass true.
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
>> news:1168267586.253223.301500[ at ]38g2000cwa.googlegroups.com...
>> > Im trying to use the method GetIDsFromNames (C#) but I dont know what
>> > each parameter is for:
>> >
>> > int GetIDsFromNames(object MAPIProp, string GUID, object ID, bool
>> > bCreate)
>> >
>> > I know waht are GUID and ID but I dont know what the other two
>> > parameters are, Can anyone please help me?
>> >
>


Re: How to use GetIDsFromNames(....) method ?
"Wassim Dagash" <wassim.dagash[ at ]gmail.com> 1/9/2007 9:05:43 AM
Hello Dimitry,

I tried to use the folder MAPIOBJECT but it seems like
GetIDsFromNames returns different integer than expected (for "start"
named property) , I did the following test:

int n =
mUtils.GetIDsFromNames(calFold.MAPIOBJECT,"{00062002-0000-0000-C000-000000000046}",0x820D,true);

int m = unchecked((int) 0x80320040);


m and n are supposed to be equal but they aren't. Do you have an idea
why it could happen ?

Dmitry Streblechenko wrote:
[Quoted Text]
> You can check that Items.Count > 0 (otherwise there is no point using a
> Restriction) and pass the very first item from the folder. Or you can pass
> the folder itself - all Redemption cares about is that the object passed as
> the first parameter implements a MAPIOBJECT property.
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
> news:1168278981.157304.265170[ at ]s34g2000cwa.googlegroups.com...
> > Hello Dmitry,
> > Im trying to use redemption in order to build a ristrict on the
> > items of outlook calendar.The restriction is simple: getting all
> > meeting in a range. I tried to use PR_START_DATE and PR_END_DATE
> > properties for ulPropTag but it seems like not all appointments in OL
> > calendar got these two properties ( compare by outlook spy), therfore I
> > tried to use "start" and "end" named properties as ulPropTag , but it
> > failed cause the name properies should be converted . Im trying to use
> > GetIDsFromNames inorder to get this convertion. In that case I think
> > I've some kind of "deadlock" : Im trying to use GetIDsFromNames
> > inorder to get the item and the function needs the item as parameter.
> > Do you have any idea how could solve this issue? I'll appreciate your
> > help.
> >
> > Dmitry Streblechenko wrote:
> >> Is that for Redemption (looks like it judging from the method signature)?
> >> The first parameter is the object (such as MailItem from the Outlook
> >> Object
> >> Model). The last parameter allows you to specify whether the mapping must
> >> be
> >> created if it's never been used before for the given message store.
> >> E.g. if you specify false, you will get back 0 if the particular
> >> combination
> >> of GUID/id has never been used. In most cases, you need to pass true.
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
> >> news:1168267586.253223.301500[ at ]38g2000cwa.googlegroups.com...
> >> > Im trying to use the method GetIDsFromNames (C#) but I dont know what
> >> > each parameter is for:
> >> >
> >> > int GetIDsFromNames(object MAPIProp, string GUID, object ID, bool
> >> > bCreate)
> >> >
> >> > I know waht are GUID and ID but I dont know what the other two
> >> > parameters are, Can anyone please help me?
> >> >
> >

Re: How to use GetIDsFromNames(....) method ?
"Wassim Dagash" <wassim.dagash[ at ]gmail.com> 1/9/2007 1:18:09 PM
I also tried to perform a reverse test:

int m = unchecked((int) 0x80320040);
Redemption.NamedProperty np1 =
mUtils.GetNamesFromIDs(calFold.MAPIOBJECT,m);

string s1 = np1.ID.ToString();
int s = Int32.Parse(s1);
int n =
mUtils.GetIDsFromNames(calFold.MAPIOBJECT,"{00062002-0000-0000-C000-000000000046}",s,true);

n supposed to be equal to m but it's not , what Im doing wrong ?

Wassim Dagash wrote:
[Quoted Text]
> Hello Dimitry,
>
> I tried to use the folder MAPIOBJECT but it seems like
> GetIDsFromNames returns different integer than expected (for "start"
> named property) , I did the following test:
>
> int n =
> mUtils.GetIDsFromNames(calFold.MAPIOBJECT,"{00062002-0000-0000-C000-000000000046}",0x820D,true);
>
> int m = unchecked((int) 0x80320040);
>
>
> m and n are supposed to be equal but they aren't. Do you have an idea
> why it could happen ?
>
> Dmitry Streblechenko wrote:
> > You can check that Items.Count > 0 (otherwise there is no point using a
> > Restriction) and pass the very first item from the folder. Or you can pass
> > the folder itself - all Redemption cares about is that the object passed as
> > the first parameter implements a MAPIOBJECT property.
> >
> > Dmitry Streblechenko (MVP)
> > http://www.dimastr.com/
> > OutlookSpy - Outlook, CDO
> > and MAPI Developer Tool
> >
> > "Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
> > news:1168278981.157304.265170[ at ]s34g2000cwa.googlegroups.com...
> > > Hello Dmitry,
> > > Im trying to use redemption in order to build a ristrict on the
> > > items of outlook calendar.The restriction is simple: getting all
> > > meeting in a range. I tried to use PR_START_DATE and PR_END_DATE
> > > properties for ulPropTag but it seems like not all appointments in OL
> > > calendar got these two properties ( compare by outlook spy), therfore I
> > > tried to use "start" and "end" named properties as ulPropTag , but it
> > > failed cause the name properies should be converted . Im trying to use
> > > GetIDsFromNames inorder to get this convertion. In that case I think
> > > I've some kind of "deadlock" : Im trying to use GetIDsFromNames
> > > inorder to get the item and the function needs the item as parameter.
> > > Do you have any idea how could solve this issue? I'll appreciate your
> > > help.
> > >
> > > Dmitry Streblechenko wrote:
> > >> Is that for Redemption (looks like it judging from the method signature)?
> > >> The first parameter is the object (such as MailItem from the Outlook
> > >> Object
> > >> Model). The last parameter allows you to specify whether the mapping must
> > >> be
> > >> created if it's never been used before for the given message store.
> > >> E.g. if you specify false, you will get back 0 if the particular
> > >> combination
> > >> of GUID/id has never been used. In most cases, you need to pass true.
> > >>
> > >> Dmitry Streblechenko (MVP)
> > >> http://www.dimastr.com/
> > >> OutlookSpy - Outlook, CDO
> > >> and MAPI Developer Tool
> > >>
> > >> "Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
> > >> news:1168267586.253223.301500[ at ]38g2000cwa.googlegroups.com...
> > >> > Im trying to use the method GetIDsFromNames (C#) but I dont know what
> > >> > each parameter is for:
> > >> >
> > >> > int GetIDsFromNames(object MAPIProp, string GUID, object ID, bool
> > >> > bCreate)
> > >> >
> > >> > I know waht are GUID and ID but I dont know what the other two
> > >> > parameters are, Can anyone please help me?
> > >> >
> > >

Re: How to use GetIDsFromNames(....) method ?
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 1/9/2007 5:11:12 PM
Did you test it on an item that comes from that folder? What is the
int m = unchecked((int) 0x80320040);
line?

I had no problems with the following script in OutlookSpy (click "Script
Editor", paste the script, click Run):

set mUtils = CreateObject("Redemption.MAPIUtils")
set Folder = Application.ActiveExplorer.CurrentFolder
set Item = Folder.Items(1)
FolderTag = mUtils.GetIDsFromNames(Folder,
"{00062002-0000-0000-C000-000000000046}", &H820D,true) or &H0040
ItemTag = mUtils.GetIDsFromNames(Item,
"{00062002-0000-0000-C000-000000000046}", &H820D,true) or &H0040
MsgBox Hex(FolderTag) & " - " & Hex(ItemTag)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
news:1168348689.259401.236020[ at ]s34g2000cwa.googlegroups.com...
[Quoted Text]
>I also tried to perform a reverse test:
>
> int m = unchecked((int) 0x80320040);
> Redemption.NamedProperty np1 =
> mUtils.GetNamesFromIDs(calFold.MAPIOBJECT,m);
>
> string s1 = np1.ID.ToString();
> int s = Int32.Parse(s1);
> int n =
> mUtils.GetIDsFromNames(calFold.MAPIOBJECT,"{00062002-0000-0000-C000-000000000046}",s,true);
>
> n supposed to be equal to m but it's not , what Im doing wrong ?
>
> Wassim Dagash wrote:
>> Hello Dimitry,
>>
>> I tried to use the folder MAPIOBJECT but it seems like
>> GetIDsFromNames returns different integer than expected (for "start"
>> named property) , I did the following test:
>>
>> int n =
>> mUtils.GetIDsFromNames(calFold.MAPIOBJECT,"{00062002-0000-0000-C000-000000000046}",0x820D,true);
>>
>> int m = unchecked((int) 0x80320040);
>>
>>
>> m and n are supposed to be equal but they aren't. Do you have an idea
>> why it could happen ?
>>
>> Dmitry Streblechenko wrote:
>> > You can check that Items.Count > 0 (otherwise there is no point using a
>> > Restriction) and pass the very first item from the folder. Or you can
>> > pass
>> > the folder itself - all Redemption cares about is that the object
>> > passed as
>> > the first parameter implements a MAPIOBJECT property.
>> >
>> > Dmitry Streblechenko (MVP)
>> > http://www.dimastr.com/
>> > OutlookSpy - Outlook, CDO
>> > and MAPI Developer Tool
>> >
>> > "Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
>> > news:1168278981.157304.265170[ at ]s34g2000cwa.googlegroups.com...
>> > > Hello Dmitry,
>> > > Im trying to use redemption in order to build a ristrict on the
>> > > items of outlook calendar.The restriction is simple: getting all
>> > > meeting in a range. I tried to use PR_START_DATE and PR_END_DATE
>> > > properties for ulPropTag but it seems like not all appointments in OL
>> > > calendar got these two properties ( compare by outlook spy), therfore
>> > > I
>> > > tried to use "start" and "end" named properties as ulPropTag , but it
>> > > failed cause the name properies should be converted . Im trying to
>> > > use
>> > > GetIDsFromNames inorder to get this convertion. In that case I think
>> > > I've some kind of "deadlock" : Im trying to use GetIDsFromNames
>> > > inorder to get the item and the function needs the item as parameter.
>> > > Do you have any idea how could solve this issue? I'll appreciate your
>> > > help.
>> > >
>> > > Dmitry Streblechenko wrote:
>> > >> Is that for Redemption (looks like it judging from the method
>> > >> signature)?
>> > >> The first parameter is the object (such as MailItem from the Outlook
>> > >> Object
>> > >> Model). The last parameter allows you to specify whether the mapping
>> > >> must
>> > >> be
>> > >> created if it's never been used before for the given message store.
>> > >> E.g. if you specify false, you will get back 0 if the particular
>> > >> combination
>> > >> of GUID/id has never been used. In most cases, you need to pass
>> > >> true.
>> > >>
>> > >> Dmitry Streblechenko (MVP)
>> > >> http://www.dimastr.com/
>> > >> OutlookSpy - Outlook, CDO
>> > >> and MAPI Developer Tool
>> > >>
>> > >> "Wassim Dagash" <wassim.dagash[ at ]gmail.com> wrote in message
>> > >> news:1168267586.253223.301500[ at ]38g2000cwa.googlegroups.com...
>> > >> > Im trying to use the method GetIDsFromNames (C#) but I dont know
>> > >> > what
>> > >> > each parameter is for:
>> > >> >
>> > >> > int GetIDsFromNames(object MAPIProp, string GUID, object ID, bool
>> > >> > bCreate)
>> > >> >
>> > >> > I know waht are GUID and ID but I dont know what the other two
>> > >> > parameters are, Can anyone please help me?
>> > >> >
>> > >
>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net