PC Review


Reply
Thread Tools Rate Thread

How to programmatically switch to "Group By" view in Outlook

 
 
Kirk
Guest
Posts: n/a
 
      4th Nov 2005
I would like to programmatically (VB) switch the current view to "Group
by - Category". I know I can do this by using the settings in Outlook,
but I have my reasons for wanting to do this via VB. Basically, when I
click a header to resort by that field, I want to create another button
that reverts back to the "Group by" view on a single click.

I have seen some similar posts regarding this issue, but I have yet to
see one that posted really useful information, such as sample code or
just some keywords or concepts to research in the Outlook VBA helpfile.

I would greatly appreciate any suggestions or links that anyone could
give me.
Thanx!

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==
Guest
Posts: n/a
 
      4th Nov 2005
Changing the view is a simple matter of grabbing an Explorer object for the
current Outlook window and passing the name of the view to the CurrentView
property. See this section of the VBA reference for a great example:

CurrentView Property [Outlook 2003 VBA Language Reference]:
http://msdn.microsoft.com/library/en...asp?frame=true

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Kirk" wrote:

> I would like to programmatically (VB) switch the current view to "Group
> by - Category". I know I can do this by using the settings in Outlook,
> but I have my reasons for wanting to do this via VB. Basically, when I
> click a header to resort by that field, I want to create another button
> that reverts back to the "Group by" view on a single click.
>
> I have seen some similar posts regarding this issue, but I have yet to
> see one that posted really useful information, such as sample code or
> just some keywords or concepts to research in the Outlook VBA helpfile.
>
> I would greatly appreciate any suggestions or links that anyone could
> give me.
> Thanx!
>
>

 
Reply With Quote
 
Kirk
Guest
Posts: n/a
 
      7th Nov 2005
Thanks for your quick response. Unfortuately, I don't think this
solution will help me.

Your response dealt with "views" in Outlook. I know how to switch
views like this:

Sub ChangeView(strViewName)
Dim objOL
Set objOL = CreateObject("Outlook.Application")
objOL.ActiveExplorer.CurrentView = strViewName
Set objOL = Nothing
End Sub

MY problem is how to change to the "Group By" view of categories. My
method will switch to the correct view, but it does not remember or set
the "Group By" arrangement. Please let me know if you can guide me
further.

Thanx!

 
Reply With Quote
 
=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==
Guest
Posts: n/a
 
      7th Nov 2005
To change the properties of a specific view, you have to manipulate the XML
in the View.XML property. It can be a little daunting, but these articles
can set you on the right track:

Creating Custom Views (Microsoft Outlook 2002 Technical Articles):
http://msdn.microsoft.com/library/en...asp?frame=true

XML View Definitions (Microsoft Outlook 2002 Technical Articles):
http://msdn.microsoft.com/library/en...asp?frame=true

There is also a View Manipulation.zip file containing sample code on
http://www.OutlookCode.com somewhere, but I can't find it. Sue?

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Kirk" wrote:

> Thanks for your quick response. Unfortuately, I don't think this
> solution will help me.
>
> Your response dealt with "views" in Outlook. I know how to switch
> views like this:
>
> Sub ChangeView(strViewName)
> Dim objOL
> Set objOL = CreateObject("Outlook.Application")
> objOL.ActiveExplorer.CurrentView = strViewName
> Set objOL = Nothing
> End Sub
>
> MY problem is how to change to the "Group By" view of categories. My
> method will switch to the correct view, but it does not remember or set
> the "Group By" arrangement. Please let me know if you can guide me
> further.
>
> Thanx!
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lost "customise view" so cannot switch from winter to summer view =?Utf-8?B?aG9vcGV5YmlyZA==?= Microsoft Outlook Calendar 4 17th Aug 2006 10:26 PM
In Table View can I group by "Date" instead of "Start" =?Utf-8?B?S0xN?= Microsoft Outlook Calendar 1 11th Jan 2006 05:52 AM
"Switch to Classic View" in "Control Panel" is missing. =?Utf-8?B?Z2Vycm9z?= Windows XP Embedded 2 28th Jul 2005 06:00 AM
Change "Group by" in view programmatically KS Microsoft Outlook VBA Programming 1 12th Apr 2005 06:38 AM
Programmatically switch off "Variable declaration reqiured" in VBE? Alan Microsoft Excel Programming 6 15th Dec 2004 11:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:36 AM.