How do I get the items in a collapsed group?

Status
Not open for further replies.

J. Farro

Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
Posted this question elsewhere but never got a response:
What code allows me to get the email items when the selection is on a header of a collapsed group?
So for example if the explorer window looks like this:


Or if it looks like this when some groups are collapsed:


What code allows me to get all the items for the highlighted selection?
 

J. Farro

Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
The ony property for selected items is Explorer.Selection. If you select the group header, Selection.Count is 0. So, no way.
Michael,
This confirms what I saw. Is there a way by code to expand a group and then select the items in the collapsed group?
This would be similar to what MS is doing when you select a collapsed header and then click delete: It tells you that the action will be applied to all items in selected group, and then expands, selects all in group and deletes them.
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Frankly, there´s a new function, which I´d overseen. See Explorer.Selection.GetSelection. Unfortunately, this only works for the ConversationView (at least on my pretty old version of OL 2016). If a conversation header is selected, GetSelection(1) returns the new ConversationHeader object. See its methods in the object explorer (press f2).
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Using the sample on that page - it looks like either it doesn't get all the items in the conversation (gets only the first) or the code is not right... it doesn't do anything with the new conversational view either - but more importantly, it doesn't crash using that view, so there might be hope.
 

J. Farro

Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
Using the sample on that page - it looks like either it doesn't get all the items in the conversation (gets only the first) or the code is not right... it doesn't do anything with the new conversational view either - but more importantly, it doesn't crash using that view, so there might be hope.
I posted on msdn code and debug output. GetSelection(Outlook.OlSelectionContents.olConversationHeaders) only worked for me when parsing threaded conversations, but not grouped emails. Maybe there is another way. There should be. Maybe Microsoft needs to update its API with a new constant:
GetSelection(Outlook.OlSelectionContents.olGroupedHeaders)
Microsoft, are you listening ?????
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Just played with it in ol2010. There it doesn´t work at all. Perhaps that´s why everyone has missed the function since at least 2010 :)
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I tested it using a 'normal' outlook 2016 conversation - view was group by day, conversations grouped within the days - i selected one conversation. I think that scenario is where any sane person would expect it to work. :)
 

J. Farro

Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
How does one get this to the attention of Microsoft? How does one report bugs and is there any traction in getting them fixed?
.. cause I found a few more bugs ...
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
For programming bugs, i think opening a support case is best but if you have good repro steps, post in the msdn forums and give me the link - I'll ask the outlook dev mvps to take a look and we'll bring it to the attention of Microsoft. No guarantee it will be fixed though...

For suggestions, they recommend outlook.uservoice.com but I'm not sure if that works as good for programming.
 

J. Farro

Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
For programming bugs, i think opening a support case is best but if you have good repro steps, post in the msdn forums and give me the link - I'll ask the outlook dev mvps to take a look and we'll bring it to the attention of Microsoft. No guarantee it will be fixed though...

For suggestions, they recommend outlook.uservoice.com but I'm not sure if that works as good for programming.
Diane,
The link to the MSDN article was provided above. Here it is again for clarity:
Cannot retrieve email items in collapsed groups with GetSelection()

Note- last comment is from a moderator that just said something along the lines it can't be done. Well, we can see that - but it needs to work, hence it is a bug.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I'm not sure if it should be a bug (or just a stupid name for what it really does) but we'll see what the other devs say.


Sent from my iPhone using Tapatalk
 
Status
Not open for further replies.
Top