Define and Apply Views In Outlook 2003

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

Guest

Hi

I've got a number of email folders, each of which uses the same customised
view I call "My View". Quite often, the view disappears from the drop-down
box and the 'define views' menu so I need to recreate it, then apply to each
folder in turn. Which is a pain!

What I'd like to do is to have some VBA code that could recreate the view
(with all its settings defined), and then apply it to all of my mail folders.

Is this possible? Any help much appreciated.

Thanks

Rob F

P.S. Is there also a way of making views 'read-only' so they can't be
deleted in the first place?
 
Am Tue, 25 Oct 2005 05:03:03 -0700 schrieb Rob F:

Rob, you can create your view once more again and then read its XML property
with VBA. Please see the ObjectBrowser (F2) for all the View object´s
properties.

Once, you got the XML property, you could store it somewhere save. Now
you´re able to re-create the same view by using Views.Add if necessary.

The View object has also a LockUserChanges property. I don´t know if that
would prevent you from losing the view every now and again.
 
How would I do this? I've got the code from the help system to get the XML,
so I could save a file called "myview.xml".

But what is the VBA code using View.Add or whatever to recreate the view in
Outlook, and then apply it to my mail folders?

Thanks

Rob F
 
Hi Rob
If you create a new view, you can select it for all folders based on post
type or only the current folder. So once you had created the new view, it
must be available for all folders. Well, you can create a view also via VBA,
cause the view is part of the object model from outlook. (there is a
ressouce kit available form MS to use the view control in VB. Imaging, you
will use the view on differet PCs, you must search by date and time for the
modified file (after the midification) into your user/application folder
for outlook. (I dont know the folder names in english, cause I use the
German version) than you can replace it. Or you can use the tool in office
programm menu to save the customized settings in a file.

Hope it will helps !

Michael
 
Thanks, Michael.

I can use VBA to get the XML code for the view I want, and find the file how
you say. But what is the actual VBA code to recreate and apply that XML file
as a view?

Thanks

Rob F
 
Am Wed, 26 Oct 2005 00:43:04 -0700 schrieb Rob F:

You can apply the XML e.g. to the current folder´s current view, exp.:

With Application.ActiveExplorer.CurrentFolder.CurrentView
.Xml = "your xml string"
.Apply
.Save
End with
 
Hi Rob

I'm not sure that you need VBA. Could you test to copy this XML from one
machine to another ? Maybe a registry entry will necessary.

Michael
 
Back
Top