![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
My Outlook 2007 archives emails to a "archivel" folder tree structure that is parallel to my mailbox folders. I've written a macro that switches between a folder and its archive (see below) As a safety measure, I want the "archivel" folder collapsed altogether when I switch back to the non-archive folder, so that I don't confuse its folders with the normal ones - any Idea how I do this? Thanx in advance. ---------------------------------- Sub SwitchBetweenCurrentFolderAndItsArchive() Dim names As Collection Set names = New Collection Dim cf As Folder Set cf = Application.ActiveExplorer.CurrentFolder Set f = cf Do While Not f Is Nothing And TypeOf f Is MAPIFolder names.Add (f.Name) Set f = f.Parent Loop Dim newf As Folder If names(names.Count) "Archivel Folders" Then Set newf = f.Folders("Archivel Folders") MsgBox "Switching from a folder to its ARCHIVE" Else Set newf = f.GetDefaultFolder(olFolderInbox).Parent MsgBox "Switching from an archive back to its FOLDER" End If ' remove 'mailbox' item names.Remove (names.Count) While names.Count 0 'MsgBox names.Item(names.Count) Set newf = newf.Folders(names.Item(names.Count)) names.Remove (names.Count) Wend Set Application.ActiveExplorer.CurrentFolder = newf End Sub |
Ads |
#2
|
|||
|
|||
![]()
"udo" wrote in message
... My Outlook 2007 archives emails to a "archivel" folder tree structure that is parallel to my mailbox folders. I've written a macro that switches between a folder and its archive (see below) As a safety measure, I want the "archivel" folder collapsed altogether when I switch back to the non-archive folder, so that I don't confuse its folders with the normal ones - any Idea how I do this? Programming questions belong in microsoft.public.outlook.program_vba -- Brian Tillman [MVP-Outlook] |
#3
|
|||
|
|||
![]()
On Feb 2, 3:32*pm, "Brian Tillman [MVP - Outlook]"
wrote: "udo" wrote in message ... My Outlook 2007 archives emails to a "archivel" folder tree structure that is parallel to my mailbox folders. I've written a macro that switches between a folder and its archive (see below) As a safety measure, I want the "archivel" folder collapsed altogether when I switch back to the non-archive folder, so that I don't confuse its folders with the normal ones - any Idea how I do this? Programming questions belong in microsoft.public.outlook.program_vba -- Brian Tillman [MVP-Outlook] Thanks - I posted there now. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Save mail in a specific folder | thomas | Outlook and VBA | 4 | July 13th 08 03:02 AM |
Move email from specific folder (under the inbox) to a specific fo | Emil | Outlook and VBA | 3 | June 15th 08 07:23 PM |
Set specific right margin in Outlook 2007 e-mail | Douglas O. Walker | Outlook - General Queries | 2 | December 2nd 07 07:57 PM |
Rules for moving outside mails to specific folder (Macro) | Moshico | Outlook and VBA | 1 | January 22nd 07 03:03 PM |
How to direct mail to specific folder | crapit | Outlook - General Queries | 2 | May 16th 06 03:47 AM |