Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Outlook Sort Macro (http://www.outlookbanter.com/outlook-vba/53844-outlook-sort-macro.html)

Jim Conrady August 1st 07 10:46 PM

Outlook Sort Macro
 
Folks, I have searched many of the MSDN forums as well as a few Google
searches, and cannot come up with an easy way to do this, so let me ask the
experts.

I deal with a lot of email every day. Sometimes I need to see the emails
sorted by date, sometimes by who they are from, and sometimes by Subject. I
know I can take my hands off the keyboard, right click the mouse on the
header bar, then pick date, from, subject... Being the old school hands on
the keyboard guy I am, my preference is to come up with 3 macros that I can
assign to hot keys. This is the kind of thing that is a piece of cake in
Excel with the macro recorder, but I am having a giggle figuring out where to
start on Outlook.

I have slightly more than entry-level knowledge of Excel VBA... Looking for
a sample, or a pointer to some doc that may help me out.

I'd appreciate the help!

Jim
--
--------------
Jim Conrady

Michael Bauer [MVP - Outlook] August 2nd 07 06:03 AM

Outlook Sort Macro
 


You might start with the Object Browser (f2), which is very helpful. Switch
from All Libraries to Outlook and type in 'sort'. It lists one Sort method
for the Items collection. Select that and click f1 for a sample.

Via Toolbars/Customize you can create one button for each macro. Name each
button with a '&' before the character that should be used as the 'hotkey'.
That works if you find characters that aren't being used already.

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

Am Wed, 1 Aug 2007 14:46:09 -0700 schrieb Jim Conrady:

Folks, I have searched many of the MSDN forums as well as a few Google
searches, and cannot come up with an easy way to do this, so let me ask

the
experts.

I deal with a lot of email every day. Sometimes I need to see the emails
sorted by date, sometimes by who they are from, and sometimes by Subject.

I
know I can take my hands off the keyboard, right click the mouse on the
header bar, then pick date, from, subject... Being the old school hands

on
the keyboard guy I am, my preference is to come up with 3 macros that I

can
assign to hot keys. This is the kind of thing that is a piece of cake in
Excel with the macro recorder, but I am having a giggle figuring out where

to
start on Outlook.

I have slightly more than entry-level knowledge of Excel VBA... Looking

for
a sample, or a pointer to some doc that may help me out.

I'd appreciate the help!

Jim


Sue Mosher [MVP-Outlook] August 2nd 07 01:44 PM

Outlook Sort Macro
 
Unfortunately, sorting the Items collection programmatically doesn't affect the screen display.

The way I'd approach this is to create a new table view for each sort. Then each macro should be as simple as:

Sub ShowViewA()
Application.ActiveExplorer.CurrentView = "ViewA"
End Sub

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Michael Bauer [MVP - Outlook]" wrote in message ...


You might start with the Object Browser (f2), which is very helpful. Switch
from All Libraries to Outlook and type in 'sort'. It lists one Sort method
for the Items collection. Select that and click f1 for a sample.

Via Toolbars/Customize you can create one button for each macro. Name each
button with a '&' before the character that should be used as the 'hotkey'.
That works if you find characters that aren't being used already.

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

Am Wed, 1 Aug 2007 14:46:09 -0700 schrieb Jim Conrady:

Folks, I have searched many of the MSDN forums as well as a few Google
searches, and cannot come up with an easy way to do this, so let me ask

the
experts.

I deal with a lot of email every day. Sometimes I need to see the emails
sorted by date, sometimes by who they are from, and sometimes by Subject.

I
know I can take my hands off the keyboard, right click the mouse on the
header bar, then pick date, from, subject... Being the old school hands

on
the keyboard guy I am, my preference is to come up with 3 macros that I

can
assign to hot keys. This is the kind of thing that is a piece of cake in
Excel with the macro recorder, but I am having a giggle figuring out where

to
start on Outlook.

I have slightly more than entry-level knowledge of Excel VBA... Looking

for
a sample, or a pointer to some doc that may help me out.

I'd appreciate the help!

Jim


Michael Bauer [MVP - Outlook] August 3rd 07 05:43 AM

Outlook Sort Macro
 


You're right, of course :)

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

Am Thu, 2 Aug 2007 08:44:12 -0400 schrieb Sue Mosher [MVP-Outlook]:

Unfortunately, sorting the Items collection programmatically doesn't

affect the screen display.

The way I'd approach this is to create a new table view for each sort.

Then each macro should be as simple as:

Sub ShowViewA()
Application.ActiveExplorer.CurrentView = "ViewA"
End Sub



All times are GMT +1. The time now is 02:27 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com