A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Programmatic construction (macro) to make complex views on the fly



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 5th 08, 03:46 PM posted to microsoft.public.outlook.program_vba
jimboluke
external usenet poster
 
Posts: 13
Default Programmatic construction (macro) to make complex views on the fly

I really feel that the ability to specify filters in SQL is truly an enabling
feature in Outlook. My way of organizing tens of thousands of emails is to
actually leave them in one big folder (I start a new one each year), and to
use categories as tags. Categories is really a nice field because you can
assign multiple ones per message. I expose this field and sort by it in
message view, and it blows away (to me) the notion of making many neat little
folders and trying to figure out which one a message should go into (or
copying it multiple times into multiple folders). It's a real power method
for organizing messages, cause you can easily change, consolidate, and tweak
the categories of multiple messages very quickly. Imagine trying to do this
with folders, where you can really only see into them one folder at a time.

Often, even in this method, I need to narrow down my search. I can still
find 1000 messages having a specific category, which I can sometimes deal
with by employing a secondary grouping, but I cannot sadly group by
categories within a grouping by categories (too much recursion I guess). Say
I want to find things having two categories, "NPS" and "AMES". I only have
one message with both categories, but I have 500 messages that have NPS and
700 messages that have AMES. With the ability to customize a filter in

views using SQL, I can do something like this:

("urn:schemas-microsoft-comfficeffice#Keywords" LIKE '%NPS%' AND
"urn:schemas-microsoft-comfficeffice#Keywords" LIKE '%AMES%')

and this prunes away the clutter very quickly to the single one message that
related to both those category tags. In fact, that is the only way I can
quickly find those intersections.

SORRY FOR THE LONG PREAMBLE, but this is my zillion dollar question: Can we
use macros to define view filters on the fly? Instead of having to clumsily
click through a bunch of stuff to get to the filter dialog and type it in,
I'd like to get to the point of having quick-select macros that can help me
find things in a flash. No more clicking through pigeon-holed folders, I
can't go back at this point.

-jim
Ads
  #2  
Old September 5th 08, 04:08 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Programmatic construction (macro) to make complex views on the fly

Yes, it can be done, but the details depend on your Outlook version, which
you should always include when posting to an Outlook forum.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"JIMBOLUKE" wrote:

I really feel that the ability to specify filters in SQL is truly an enabling
feature in Outlook. My way of organizing tens of thousands of emails is to
actually leave them in one big folder (I start a new one each year), and to
use categories as tags. Categories is really a nice field because you can
assign multiple ones per message. I expose this field and sort by it in
message view, and it blows away (to me) the notion of making many neat little
folders and trying to figure out which one a message should go into (or
copying it multiple times into multiple folders). It's a real power method
for organizing messages, cause you can easily change, consolidate, and tweak
the categories of multiple messages very quickly. Imagine trying to do this
with folders, where you can really only see into them one folder at a time.

Often, even in this method, I need to narrow down my search. I can still
find 1000 messages having a specific category, which I can sometimes deal
with by employing a secondary grouping, but I cannot sadly group by
categories within a grouping by categories (too much recursion I guess). Say
I want to find things having two categories, "NPS" and "AMES". I only have
one message with both categories, but I have 500 messages that have NPS and
700 messages that have AMES. With the ability to customize a filter in

views using SQL, I can do something like this:

("urn:schemas-microsoft-comfficeffice#Keywords" LIKE '%NPS%' AND
"urn:schemas-microsoft-comfficeffice#Keywords" LIKE '%AMES%')

and this prunes away the clutter very quickly to the single one message that
related to both those category tags. In fact, that is the only way I can
quickly find those intersections.

SORRY FOR THE LONG PREAMBLE, but this is my zillion dollar question: Can we
use macros to define view filters on the fly? Instead of having to clumsily
click through a bunch of stuff to get to the filter dialog and type it in,
I'd like to get to the point of having quick-select macros that can help me
find things in a flash. No more clicking through pigeon-holed folders, I
can't go back at this point.


  #3  
Old September 5th 08, 07:20 PM posted to microsoft.public.outlook.program_vba
jimboluke
external usenet poster
 
Posts: 13
Default Programmatic construction (macro) to make complex views on the

Sorry, it's 2007, I was making the post too long....

"Sue Mosher [MVP-Outlook]" wrote:

Yes, it can be done, but the details depend on your Outlook version, which
you should always include when posting to an Outlook forum.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"JIMBOLUKE" wrote:

I really feel that the ability to specify filters in SQL is truly an enabling
feature in Outlook. My way of organizing tens of thousands of emails is to
actually leave them in one big folder (I start a new one each year), and to
use categories as tags. Categories is really a nice field because you can
assign multiple ones per message. I expose this field and sort by it in
message view, and it blows away (to me) the notion of making many neat little
folders and trying to figure out which one a message should go into (or
copying it multiple times into multiple folders). It's a real power method
for organizing messages, cause you can easily change, consolidate, and tweak
the categories of multiple messages very quickly. Imagine trying to do this
with folders, where you can really only see into them one folder at a time.

Often, even in this method, I need to narrow down my search. I can still
find 1000 messages having a specific category, which I can sometimes deal
with by employing a secondary grouping, but I cannot sadly group by
categories within a grouping by categories (too much recursion I guess). Say
I want to find things having two categories, "NPS" and "AMES". I only have
one message with both categories, but I have 500 messages that have NPS and
700 messages that have AMES. With the ability to customize a filter in

views using SQL, I can do something like this:

("urn:schemas-microsoft-comfficeffice#Keywords" LIKE '%NPS%' AND
"urn:schemas-microsoft-comfficeffice#Keywords" LIKE '%AMES%')

and this prunes away the clutter very quickly to the single one message that
related to both those category tags. In fact, that is the only way I can
quickly find those intersections.

SORRY FOR THE LONG PREAMBLE, but this is my zillion dollar question: Can we
use macros to define view filters on the fly? Instead of having to clumsily
click through a bunch of stuff to get to the filter dialog and type it in,
I'd like to get to the point of having quick-select macros that can help me
find things in a flash. No more clicking through pigeon-holed folders, I
can't go back at this point.


  #4  
Old September 5th 08, 07:42 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Programmatic construction (macro) to make complex views on the

In Outlook 2007, it's easy: Return the view that you want to work with as a
TableView object, then set its Filter property to your query string. For
example:

Public Sub Filter1()
Dim strQuery As String
Dim vw As View
Dim tvw As TableView

strQuery = "(""urn:schemas-microsoft-comfficeffice#Keywords"" LIKE
'%NPS%') " & _
"AND (""urn:schemas-microsoft-comfficeffice#Keywords"" LIKE
'%AMES%')"

Set vw = Application.ActiveExplorer.CurrentView
If vw.ViewType = olTableView Then
Set tvw = vw
tvw.Filter = strQuery
tvw.Apply
End If

Set vw = Nothing
Set tvw = Nothing
End Sub
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"Sue Mosher [MVP-Outlook]" wrote:

Yes, it can be done, but the details depend on your Outlook version, which
you should always include when posting to an Outlook forum.



"JIMBOLUKE" wrote:

I want to find things having two categories, "NPS" and "AMES". I only have
one message with both categories, but I have 500 messages that have NPS and
700 messages that have AMES. With the ability to customize a filter in

views using SQL, I can do something like this:

("urn:schemas-microsoft-comfficeffice#Keywords" LIKE '%NPS%' AND
"urn:schemas-microsoft-comfficeffice#Keywords" LIKE '%AMES%')

and this prunes away the clutter very quickly to the single one message that
related to both those category tags. In fact, that is the only way I can
quickly find those intersections.

SORRY FOR THE LONG PREAMBLE, but this is my zillion dollar question: Can we
use macros to define view filters on the fly? Instead of having to clumsily
click through a bunch of stuff to get to the filter dialog and type it in,
I'd like to get to the point of having quick-select macros that can help me
find things in a flash. No more clicking through pigeon-holed folders, I
can't go back at this point.


  #5  
Old September 5th 08, 09:38 PM posted to microsoft.public.outlook.program_vba
jimboluke
external usenet poster
 
Posts: 13
Default Programmatic construction (macro) to make complex views on the

Thanks Sue, this is neat

"Sue Mosher [MVP-Outlook]" wrote:

In Outlook 2007, it's easy: Return the view that you want to work with as a
TableView object, then set its Filter property to your query string. For
example:

Public Sub Filter1()
Dim strQuery As String
Dim vw As View
Dim tvw As TableView

strQuery = "(""urn:schemas-microsoft-comfficeffice#Keywords"" LIKE
'%NPS%') " & _
"AND (""urn:schemas-microsoft-comfficeffice#Keywords"" LIKE
'%AMES%')"

Set vw = Application.ActiveExplorer.CurrentView
If vw.ViewType = olTableView Then
Set tvw = vw
tvw.Filter = strQuery
tvw.Apply
End If

Set vw = Nothing
Set tvw = Nothing
End Sub
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"Sue Mosher [MVP-Outlook]" wrote:

Yes, it can be done, but the details depend on your Outlook version, which
you should always include when posting to an Outlook forum.



"JIMBOLUKE" wrote:

I want to find things having two categories, "NPS" and "AMES". I only have
one message with both categories, but I have 500 messages that have NPS and
700 messages that have AMES. With the ability to customize a filter in
views using SQL, I can do something like this:

("urn:schemas-microsoft-comfficeffice#Keywords" LIKE '%NPS%' AND
"urn:schemas-microsoft-comfficeffice#Keywords" LIKE '%AMES%')

and this prunes away the clutter very quickly to the single one message that
related to both those category tags. In fact, that is the only way I can
quickly find those intersections.

SORRY FOR THE LONG PREAMBLE, but this is my zillion dollar question: Can we
use macros to define view filters on the fly? Instead of having to clumsily
click through a bunch of stuff to get to the filter dialog and type it in,
I'd like to get to the point of having quick-select macros that can help me
find things in a flash. No more clicking through pigeon-holed folders, I
can't go back at this point.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail under construction Stone Monkey Outlook Express 2 March 17th 07 07:31 AM
Outlook2007 crash when sortTable is too complex. T-rev Add-ins for Outlook 0 March 15th 07 04:36 PM
Make views available in public contacts Doug Outlook - Using Contacts 1 January 29th 07 06:32 AM
Programmatic Fax Problem Yanir Outlook - Fax Functions 4 December 16th 06 05:11 PM
Complex Outlook rules - programatically? [email protected] Outlook - General Queries 3 June 27th 06 07:04 PM


All times are GMT +1. The time now is 09:11 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-2025 Outlook Banter.
The comments are property of their posters.