Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: How to find a mailitem

Geek News

How to find a mailitem
bstrum 6/20/2007 11:41:56 PM
Given a conversationindex and conversationtopic, how do I find a mailitem? I
have looked at Session.GetDefaultFolder(...).Items.Find but I do not see any
examples of how to construct the search string with these parameters.

Thank you,

Benjamin Strum
ThinkTron Corporation
Re: How to find a mailitem
"Michael Bauer [MVP - Outlook]" <mb[ at ]mvps.org> 6/21/2007 5:17:25 AM


The VBA help provides you with a sample. The easiest way is to select the
Find function in the object browser (f2) and then click f1.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize Outlook email:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Wed, 20 Jun 2007 16:41:56 -0700 schrieb bstrum:

[Quoted Text]
> Given a conversationindex and conversationtopic, how do I find a mailitem?
I
> have looked at Session.GetDefaultFolder(...).Items.Find but I do not see
any
> examples of how to construct the search string with these parameters.
>
> Thank you,
>
> Benjamin Strum
> ThinkTron Corporation
Re: How to find a mailitem
bstrum 6/21/2007 12:03:00 PM
I found the help page with shows "ConversationIndex" as a valid filter. When
I use it though, I get the exception "The property "ConversationIndex" in the
condition is not valid." Any ideas why?

My code looks like this:

string idx = ".....";
IOUT.Application app = (IOUT.Application)oApp;
IOUT.MAPIFolder f =
app.Session.GetDefaultFolder(IOUT.OlDefaultFolders.olFolderInbox);
string filter = string.Format("[ConversationIndex] = '{0}'",
idx);
object o = f.Items.Restrict(filter);

"Michael Bauer [MVP - Outlook]" wrote:

[Quoted Text]
>
>
> The VBA help provides you with a sample. The easiest way is to select the
> Find function in the object browser (f2) and then click f1.
>
> --
> Viele Gruesse / Best regards
> Michael Bauer - MVP Outlook
> Organize Outlook email:
> <http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>
>
> Am Wed, 20 Jun 2007 16:41:56 -0700 schrieb bstrum:
>
> > Given a conversationindex and conversationtopic, how do I find a mailitem?
> I
> > have looked at Session.GetDefaultFolder(...).Items.Find but I do not see
> any
> > examples of how to construct the search string with these parameters.
> >
> > Thank you,
> >
> > Benjamin Strum
> > ThinkTron Corporation
>
Re: How to find a mailitem
"Michael Bauer [MVP - Outlook]" <mb[ at ]mvps.org> 6/21/2007 12:41:37 PM


Please return to the help: There's a list on that page with invalid
properties. ConversationIndex is not allowed.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize Outlook email:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Thu, 21 Jun 2007 05:03:00 -0700 schrieb bstrum:

[Quoted Text]
> I found the help page with shows "ConversationIndex" as a valid filter.
When
> I use it though, I get the exception "The property "ConversationIndex" in
the
> condition is not valid." Any ideas why?
>
> My code looks like this:
>
> string idx = ".....";
> IOUT.Application app = (IOUT.Application)oApp;
> IOUT.MAPIFolder f =
> app.Session.GetDefaultFolder(IOUT.OlDefaultFolders.olFolderInbox);
> string filter = string.Format("[ConversationIndex] =
'{0}'",
> idx);
> object o = f.Items.Restrict(filter);
>
> "Michael Bauer [MVP - Outlook]" wrote:
>
>>
>>
>> The VBA help provides you with a sample. The easiest way is to select the
>> Find function in the object browser (f2) and then click f1.
>>
>> --
>> Viele Gruesse / Best regards
>> Michael Bauer - MVP Outlook
>> Organize Outlook email:
>>
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>
>>
>> Am Wed, 20 Jun 2007 16:41:56 -0700 schrieb bstrum:
>>
>>> Given a conversationindex and conversationtopic, how do I find a
mailitem?
>> I
>>> have looked at Session.GetDefaultFolder(...).Items.Find but I do not see
>> any
>>> examples of how to construct the search string with these parameters.
>>>
>>> Thank you,
>>>
>>> Benjamin Strum
>>> ThinkTron Corporation
>>
Re: How to find a mailitem
bstrum 6/21/2007 1:15:01 PM
So perhaps I should rephrase my original question. I am capturing the
Item_Send event. In this event, I create a postitem in another folder in
which I add a userproperty that references the "to be sent" email. I need to
be able to quickly find this sent item later. Unfortunately, the EntryID is
not available at this time. What should I use to find the sent mailitem?
Any code examples?

"Michael Bauer [MVP - Outlook]" wrote:

[Quoted Text]
>
>
> Please return to the help: There's a list on that page with invalid
> properties. ConversationIndex is not allowed.
>
> --
> Viele Gruesse / Best regards
> Michael Bauer - MVP Outlook
> Organize Outlook email:
> <http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>
>
> Am Thu, 21 Jun 2007 05:03:00 -0700 schrieb bstrum:
>
> > I found the help page with shows "ConversationIndex" as a valid filter.
> When
> > I use it though, I get the exception "The property "ConversationIndex" in
> the
> > condition is not valid." Any ideas why?
> >
> > My code looks like this:
> >
> > string idx = ".....";
> > IOUT.Application app = (IOUT.Application)oApp;
> > IOUT.MAPIFolder f =
> > app.Session.GetDefaultFolder(IOUT.OlDefaultFolders.olFolderInbox);
> > string filter = string.Format("[ConversationIndex] =
> '{0}'",
> > idx);
> > object o = f.Items.Restrict(filter);
> >
> > "Michael Bauer [MVP - Outlook]" wrote:
> >
> >>
> >>
> >> The VBA help provides you with a sample. The easiest way is to select the
> >> Find function in the object browser (f2) and then click f1.
> >>
> >> --
> >> Viele Gruesse / Best regards
> >> Michael Bauer - MVP Outlook
> >> Organize Outlook email:
> >>
> <http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>
> >>
> >> Am Wed, 20 Jun 2007 16:41:56 -0700 schrieb bstrum:
> >>
> >>> Given a conversationindex and conversationtopic, how do I find a
> mailitem?
> >> I
> >>> have looked at Session.GetDefaultFolder(...).Items.Find but I do not see
> >> any
> >>> examples of how to construct the search string with these parameters.
> >>>
> >>> Thank you,
> >>>
> >>> Benjamin Strum
> >>> ThinkTron Corporation
> >>
>
Re: How to find a mailitem
"Michael Bauer [MVP - Outlook]" <mb[ at ]mvps.org> 6/21/2007 4:46:14 PM


You can add a UserProperty to the item and search for that. Just ensure once
that the folder (probably the Sent Items folder) also has that UserProperty.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize Outlook email:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Thu, 21 Jun 2007 06:15:01 -0700 schrieb bstrum:

[Quoted Text]
> So perhaps I should rephrase my original question. I am capturing the
> Item_Send event. In this event, I create a postitem in another folder in
> which I add a userproperty that references the "to be sent" email. I need
to
> be able to quickly find this sent item later. Unfortunately, the EntryID
is
> not available at this time. What should I use to find the sent mailitem?
> Any code examples?
>
> "Michael Bauer [MVP - Outlook]" wrote:
>
>>
>>
>> Please return to the help: There's a list on that page with invalid
>> properties. ConversationIndex is not allowed.
>>
>> --
>> Viele Gruesse / Best regards
>> Michael Bauer - MVP Outlook
>> Organize Outlook email:
>>
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>
>>
>> Am Thu, 21 Jun 2007 05:03:00 -0700 schrieb bstrum:
>>
>>> I found the help page with shows "ConversationIndex" as a valid filter.
>> When
>>> I use it though, I get the exception "The property "ConversationIndex"
in
>> the
>>> condition is not valid." Any ideas why?
>>>
>>> My code looks like this:
>>>
>>> string idx = ".....";
>>> IOUT.Application app = (IOUT.Application)oApp;
>>> IOUT.MAPIFolder f =
>>> app.Session.GetDefaultFolder(IOUT.OlDefaultFolders.olFolderInbox);
>>> string filter = string.Format("[ConversationIndex] =
>> '{0}'",
>>> idx);
>>> object o = f.Items.Restrict(filter);
>>>
>>> "Michael Bauer [MVP - Outlook]" wrote:
>>>
>>>>
>>>>
>>>> The VBA help provides you with a sample. The easiest way is to select
the
>>>> Find function in the object browser (f2) and then click f1.
>>>>
>>>> --
>>>> Viele Gruesse / Best regards
>>>> Michael Bauer - MVP Outlook
>>>> Organize Outlook email:
>>>>
>>
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>
>>>>
>>>> Am Wed, 20 Jun 2007 16:41:56 -0700 schrieb bstrum:
>>>>
>>>>> Given a conversationindex and conversationtopic, how do I find a
>> mailitem?
>>>> I
>>>>> have looked at Session.GetDefaultFolder(...).Items.Find but I do not
see
>>>> any
>>>>> examples of how to construct the search string with these parameters.
>>>>>
>>>>> Thank you,
>>>>>
>>>>> Benjamin Strum
>>>>> ThinkTron Corporation
>>>>
>>
Re: How to find a mailitem
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 6/21/2007 4:48:37 PM
You'd be better off using MAPIFolder.Items.ItemAdd event (where MAPIFolder
points to Sent Items) - it will fire after the message is sent and moved to
the Sent Items folder and the entry id will be valid later.

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

"bstrum" <bstrum[ at ]discussions.microsoft.com> wrote in message
news:82F3147F-45D5-4309-A1E3-ECABB923E9E3[ at ]microsoft.com...
[Quoted Text]
> So perhaps I should rephrase my original question. I am capturing the
> Item_Send event. In this event, I create a postitem in another folder in
> which I add a userproperty that references the "to be sent" email. I need
> to
> be able to quickly find this sent item later. Unfortunately, the EntryID
> is
> not available at this time. What should I use to find the sent mailitem?
> Any code examples?
>
> "Michael Bauer [MVP - Outlook]" wrote:
>
>>
>>
>> Please return to the help: There's a list on that page with invalid
>> properties. ConversationIndex is not allowed.
>>
>> --
>> Viele Gruesse / Best regards
>> Michael Bauer - MVP Outlook
>> Organize Outlook email:
>>
>> <http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>
>>
>> Am Thu, 21 Jun 2007 05:03:00 -0700 schrieb bstrum:
>>
>> > I found the help page with shows "ConversationIndex" as a valid filter.
>> When
>> > I use it though, I get the exception "The property "ConversationIndex"
>> > in
>> the
>> > condition is not valid." Any ideas why?
>> >
>> > My code looks like this:
>> >
>> > string idx = ".....";
>> > IOUT.Application app = (IOUT.Application)oApp;
>> > IOUT.MAPIFolder f =
>> > app.Session.GetDefaultFolder(IOUT.OlDefaultFolders.olFolderInbox);
>> > string filter = string.Format("[ConversationIndex] =
>> '{0}'",
>> > idx);
>> > object o = f.Items.Restrict(filter);
>> >
>> > "Michael Bauer [MVP - Outlook]" wrote:
>> >
>> >>
>> >>
>> >> The VBA help provides you with a sample. The easiest way is to select
>> >> the
>> >> Find function in the object browser (f2) and then click f1.
>> >>
>> >> --
>> >> Viele Gruesse / Best regards
>> >> Michael Bauer - MVP Outlook
>> >> Organize Outlook email:
>> >>
>> <http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>
>> >>
>> >> Am Wed, 20 Jun 2007 16:41:56 -0700 schrieb bstrum:
>> >>
>> >>> Given a conversationindex and conversationtopic, how do I find a
>> mailitem?
>> >> I
>> >>> have looked at Session.GetDefaultFolder(...).Items.Find but I do not
>> >>> see
>> >> any
>> >>> examples of how to construct the search string with these parameters.
>> >>>
>> >>> Thank you,
>> >>>
>> >>> Benjamin Strum
>> >>> ThinkTron Corporation
>> >>
>>


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