Macro to change Folder's Group-View Settings

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What I am trying to accomplish with a macro is this:

For the folder specified [or current... either], go from a view that is not
grouped by a column to a view where it is now grouped by the Received Date.


[and if it's possible at all, just the date, and not the time, but I don't
know if that's now asking too much].

Either way, any help would be greatly appreciated.

Thanks.
Scott
 
Am Mon, 21 Nov 2005 19:37:02 -0800 schrieb scottech:

Scott, as I understand you: If the current view is not grouped by a column
then change it to group by the ReceivedDate, correct?

First you need the XML for the grouped view. The easiest way is to create
the view manually, then read the Folder.CurrentView.Xml by VBA. You can get
the entire string by e.g.:
Debug.Print Application.ActiveFolder.CurrentView.Xml

Press strg+g for opening the debug window. Copy the printed view definition,
declare a variable (constant e.g.) in your project and assign the copied
definition.

Now you know already how to read the view definition. You can search in it
with the Instr function for "<groupby>". If the function returns 0 then the
view isn´t grouped by anything and you can switch to your self-created one.
 
Back
Top