Re: Retrieving selected items from folder contents table



These are good questions, Dmitry. Before Exchange Server 2003, this is
exactly what I did - Get the EntryID from GetSelectionItem and then call
OpenEntry to find out about the message. However, two changes made this less
than desireable.

1. Available since Exchange 2000 but now the default in Exchange 2003, there
is a limit of 250 simultaneous open messages on the server by any one
client. I want to cache information about the currently selected messages
without having to open and then close each message individually. Therefore,
I get the CurrentFolder from the ActiveExplorer and open its contents table.
Addressees, subject, and all of the other information I want to remember is
in there without actually opening the message itself.

2. If the user has configured their Outlook to download headers only,
calling OpenEntry downloads the body of the message. Since I want this
information in response to an OnSelectionChange event, if I use OpenEntry it
defeats the value of headers only, since my OnSelectionChange code will
download the rest of the message as soon as it is selected.

So, I discovered through Outlook Spy that all of the information I need is
in the folder's contents table even if the user is downloading headers only.

The open message limit brings up another question. After calling OpenEntry
to get an IMessage interface pointer on the server-based message, how do I
"close" that message. I thought I would simply need to release (i.e.
IUnknown::Release()) the interface; however, a test I just finished seems to
indicate that I am still hitting the 250 message limit. (I dragged 600
messages from an Outlook folder to a folder in my message store and all of
the copies failed after 250 message has been copied.) Maybe I have a bug in
my logic to release the IMessage interface, and I will check that. Am I
correct in that this is all that is required to close the message?

Dave Smith

"Dmitry Streblechenko" <dmitry@xxxxxxxxxxx> wrote in message
news:O417DpEIGHA.740@xxxxxxxxxxxxxxxxxxxxxxx
> Message selection is a UI function. MAPI itself knows absolutely nothing
> about which mesasge is selected in Outlook. Plus you can have more than
> one explorer displaying the folder, all with different selection.
> Why do you even need to do anything with IMAPITable? If you know the entry
> ids of the selected messages from the Explorer.Selection collection, why
> not simply access these messages? What does IMAPITable give you that
> IMessage can't?
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Dave Smith" <Dave@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:uxb5dgEIGHA.1032@xxxxxxxxxxxxxxxxxxxxxxx
>> First, is there a way to set up a restriction to IMAPITable::QueryRows
>> such that it returns any row for which that item in the current
>> explorer's table view is selected?
>>
>> I have not found it; therefore, I am doing the following (using some
>> psuedocode posted some months ago by Dmitry, with my thanks).
>>
>> Open current folder from the active explorer and get its contents table
>> Use SeekRow to position to the first record - just in case
>> Cycle through the items returned from successive calls to
>> GetSelectionItem
>> For each selected item
>> Create a restriction on the EntryID
>> Call FindRow(&EIDRestrict, BOOKMARK_CURRENT ...)
>> Call QueryRows(1, 0, ...)
>> Process that record
>> Next
>> FreeProws ands get the next item from the selection
>>
>> Notice that I do not sort the contents table. If the current view is
>> sorted in descending order by receive date, this works fantastically, and
>> it really screams - performance-wise
>>
>> However, if the current view is sorted by some other column, I need to
>> sort the contents table on that same column.
>>
>> So, how can I determine the current sorting of the explorer view so that
>> I can apply that same sort to contents table and get things in order?
>>
>> Or, is there a better way?
>>
>> Dave Smith
>>
>
>


.



Relevant Pages

  • Re: Lost
    ... of protection that eats up CPUs, slows down sending, and causes a multitude ... I just got DSL as well and configured my Outlook ... "Your server has unexpectedly terminated the connection. ... Is there a way to get the selection box back? ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Retrieving selected items from folder contents table
    ... Outlook to open all selected messages and run out of the RPC channels. ... If the user has configured their Outlook to download headers only, ... >> calling OpenEntry downloads the body of the message. ... >>> one explorer displaying the folder, all with different selection. ...
    (microsoft.public.win32.programmer.messaging)
  • How create address books in Exchange2003 server?
    ... Our email server is: Exchange2003 server, ... When we download "address book" from outlook, ... selection is: Global Address List. ...
    (microsoft.public.exchange.admin)
  • outlook 2002 will not work
    ... I have been using outlook express, im trying to use outlook 2002. ... not connect to the server and when I try it asks for my email password, ... It gives me error 623 could not find a phone book entry ... for this selection. ...
    (microsoft.public.outlook.installation)
  • email duplicates
    ... I have Office 2000 Outlook and the last few months I get two to four ... duplicate emails. ... I have changed the selection for keeping emails on server ...
    (microsoft.public.access.formscoding)

Quantcast