![]() |
|
#4
|
|||
|
|||
|
Quote:
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
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 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
customize hotkeys
|
userman | Outlook | 1 | 06-06-2012 11:17 PM |
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 |
Auto insert current month's name and current year
|
Styler001 | Word | 4 | 01-25-2010 06:40 PM |