Losing format after any movement on the folder

A

Alberto

Hello, i've written a macro just to open a folder and to apply an specific
view. In this view some of the mails are colored. As soon as i click on the
button which run the macro i change to the folder and see the correct view
but as long as I scroll through the messages the format will be lost in most
of the cases. The only way to see correctly this view to me ist just
clicking on the normal folder pane, which is that I'm trying to avoid with a
button.

Here is the code:

Dim MyFolder As MAPIFolder
Dim Vista As view

Set MyFolder= GetFolder("xxxxxxxx\NameOfTheFolder") 'Sue's function
Set Outlook.ActiveExplorer.CurrentFolder = MyFolder
Set MyView = MyFolder.Views.item("PersonalView")
Vista.Apply


Thanks in advance for your answers

Alberto
 
A

Alberto

Thanks Ken

- It works fine with ActiveExplorer.CurrentView.

- By translating my code to make it more readble i confused a line and
that's why Vista.apply shouldn't have appeared this way but that wasn't the
problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top