Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-12-2013, 04:20 AM
niton niton is offline Customize Current View Windows 7 64bit Customize Current View Office 2010 64bit
Competent Performer
 
Join Date: Jul 2012
Posts: 102
niton is on a distinguished road
Default



Quote:
Originally Posted by rossmoyne View Post
Niton,

This is a good start, but it doesn't seem to finish, with how to apply to all my folders.
It doesn't say what to do, what to modify once you get to the "Custom View Oranizer" And how to apply your new template to all the subfolders.

Also, I have multiple PST folders, would I have to do this to each one? (Which is not a problem)

Thanks.
As indicated, the link provided info for folders yet to be created in Outlook 2007. The option of applying the view to already created folders is available in Outlook 2010.

If you wish, you can try this.

First verify the name of the view in this line ActiveExplorer.CurrentView = "Messages". If you find you have to change "Messages" leave the quotes in.

Select a folder then run the code.

Check it out on a test folder with subfolders before you try the inbox.

Code:
Sub Set_View()

    Dim objNS As Outlook.Namespace
    Dim myFolder As Outlook.MAPIFolder
    Dim origFolder As Outlook.MAPIFolder

    Set objNS = Application.GetNamespace("MAPI")
    Set origFolder = ActiveExplorer.CurrentFolder
    Set myFolder = origFolder

    ProcessFolder myFolder

    Set ActiveExplorer.CurrentFolder = origFolder

    Set objNS = Nothing
    Set myFolder = Nothing
    Set origFolder = Nothing

End Sub


Private Sub ProcessFolder(startfolder As Outlook.MAPIFolder)

' http://www.outlookcode.com/codedetail.aspx?id=628

    Dim objFolder As Outlook.MAPIFolder
    Dim objItem As Object
    Dim myExplorer As Explorer
       
    Set ActiveExplorer.CurrentFolder = startfolder   

    ActiveExplorer.CurrentView = "Messages"

    ' process all the subfolders of this folder
    For Each objFolder In startfolder.Folders
        ProcessFolder objFolder
    Next

End Sub
If you are unfamiliar with VBA see here http://www.slipstick.com/developer/h...ks-vba-editor/

You will find information about:
- macro security settings
- where to put the code (You can use a regular module with Insert | Module)
- how to create a button
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Customize Current View customize hotkeys userman Outlook 1 06-06-2012 11:17 PM
Customize Current View How to call current PC date and/or current PC year KIM SOLIS Excel 2 11-04-2011 06:09 PM
Current view filter applies automatically lumisy Outlook 3 03-25-2011 05:44 AM
Adding to customize view aussie Outlook 0 01-06-2011 01:00 PM
Customize Current View Auto insert current month's name and current year Styler001 Word 4 01-25-2010 06:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft