Losing format after any movement on the folder

Status
Not open for further replies.
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
 
What is Vista.Apply?

Why not use ActiveExplorer.CurrentView?

"Alberto" <Alberto> wrote in message

news:A57573F7-1C0A-4CA1-937D-2EB6D008E83A@microsoft.com...

> 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
 
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.
wrote:


> What is Vista.Apply?

> Why not use ActiveExplorer.CurrentView?

> >

>

> "Alberto" <Alberto> wrote in message
> news:A57573F7-1C0A-4CA1-937D-2EB6D008E83A@microsoft.com...
> > 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


> .
>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D Customized Contact Form Losing UDFs. Outlook VBA and Custom Forms 12
C Autocomplete losing some (not all) addresses Using Outlook 6
K Paste from Windows Clipboard then change font without losing formatting Outlook VBA and Custom Forms 1
G outlook 13 copy & paste without losing formatting Using Outlook 1
L Business Contact Mnager losing contact details BCM (Business Contact Manager) 1
B Losing Excel Data when emailing with OutLook 2010 Using Outlook 4
J How to redesign the Contact form without losing the original layout? Using Outlook 2
T How To Delete AN Email Acoount Without Losing The Data File? Using Outlook 1
K Read, unread, i'm losing clients! Using Outlook 1
D Outlook and the Dreaded Losing Shortcuts Issue Using Outlook 4
Y Losing Categories from Contacts Using Outlook 17
e_a_g_l_e_p_i MY Outlook 2021 changed the format of the shortcuts for mail, calendar etc. Using Outlook 10
M Outlook Macro to save as Email with a file name format : Date_Timestamp_Sender initial_Email subject Outlook VBA and Custom Forms 0
R How to prevent corrupted Notes format in Calendar and Contacts Using Outlook 0
S Combination Field (Date Format) Outlook VBA and Custom Forms 0
L Format Lost between Tasks and To Do Using Outlook 0
P Outlook 2016 Change Paste Special Default Format Using Outlook 8
S Format Inbox Using Outlook 0
P Short Date Format when typing in a task Using Outlook 2
D Outlook 2016 64bit, Cannot Save in 'HTML', format Using Outlook 1
K Need to convert .mmf file to .pst format Outlook VBA and Custom Forms 7
C Outlook 2016 Conditional Format for User Defined Field Using Outlook 1
C Export NSF Lotus Notes files in Outlook PST format? Using Outlook 1
L Time format in Outlook calendar and emails Using Outlook 0
Y Outlook Task View - Table Format - Customize Reminder Time to Drop-Down Selection Using Outlook 2
T How to Export mailbox from Outlook 2019 to MBOX format? Using Outlook 1
J What is the best EntryID format to set on MS Access table Outlook VBA and Custom Forms 3
e_a_g_l_e_p_i Is there a way to add something that is in the "Format Text" tab to the "basic Text" on the message tab Using Outlook 1
E Outlook 2010 Can somebody tell me , the question associated with OST format Using Outlook 1
Witzker Correct Format of custom Yes/No Checkboxes Outlook VBA and Custom Forms 0
M font format discrepancies with Quick Parts Using Outlook 1
S Email Format With Embedded Images and Tables Change Using Outlook 2
G How to filter by the format of an email address Using Outlook 6
T Format Reading Pane Outlook VBA and Custom Forms 5
R Lost PST files after format Using Outlook 6
J Outlook 2013 how to convert 2013 OST file into an another format, i m using outlook 2013 versions. Using Outlook 1
fitzgerald Lost PST files after format - how to recover deleted files? Using Outlook 3
Dr. Demento Outlook output to array -> Excel & re-format Using Outlook 2
P Outlook 2010: Missing tab - "Format/Picture Tools" HELP! Using Outlook 3
skylark53 Loss of default format on deleting signature Using Outlook 5
O Setting default format for composing/replying to emails Using Outlook 3
divan VbaProject: Changing email format Using Outlook 15
O VBA to change message format and add formatted signature Outlook VBA and Custom Forms 1
divan Macro to format email in a certain folder then forward to email address Using Outlook 3
M Macro to Format certain words in email message Outlook VBA and Custom Forms 5
J Format change when dragging from email to Task Using Outlook 1
P Outlook 2013 Phone Number Format Using Outlook 0
R How to format text within appointment/meeting body? Using Outlook 6
L Excel table format lost in Outlook Using Outlook 6
M Email Format getting changed to Plain Text Using Outlook 1

Similar threads

Back
Top