How to Auto Apply the Current View of a Folder to Its Subfolders in Outlook

When you create a folder in Outlook, the folder will automatically use the default view configured in Outlook natively. But, if you want to auto apply the current view of the folder to its new subfolders, you can use the method introduced in this post.

Perhaps you’ve customized the views of “Inbox” and “Sent Items” folders in your Outlook. Then, when you create new subfolders under the two folders, you may want to apply the parent folders’ views to the subfolders. In general, you have to manually copy or change the views. It is a bit troublesome. Thereby, here we will let Outlook auto apply the same view of a folder to its subfolders with instances of “Inbox” and “Sent Items”.

Auto Apply the Current View of a Folder to Its Subfolders

  1. At first, start Outlook program.
  2. Then, press “Alt + F11” keys to access Outlook VBA editor, according to “How to Run VBA Code in Your Outlook“.
  3. Next, in “Microsoft Visual Basic for Applications” window, copy the following VBA code into “ThisOutlookSession” project.
'Here we take "Inbox" & "Sent Items" folder as instances
Private WithEvents objInbox As Outlook.Folder
Private WithEvents objInboxFolders As Outlook.Folders
Private WithEvents objSentFolder As Outlook.Folder
Private WithEvents objSentFolders As Outlook.Folders

Private Sub Application_Startup()
    Set objInbox = Outlook.Application.Session.GetDefaultFolder(olFolderInbox)
    Set objInboxFolders = objInbox.Folders
 
    Set objSentFolder = Outlook.Application.Session.GetDefaultFolder(olFolderSentMail)
    Set objSentFolders = objSentFolder.Folders
End Sub

Private Sub objInboxFolders_FolderAdd(ByVal Folder As MAPIFolder)
    'Apply the view of "Inbox" to its new subfolder
    With Folder.CurrentView
         .XML = objInbox.CurrentView.XML
         .Save
    End With
End Sub

Private Sub objSentFolders_FolderAdd(ByVal Folder As MAPIFolder)
    'Apply the view of "Sent Items" to its new subfolder
    With Folder.CurrentView
         .XML = objSentFolder.CurrentView.XML
         .Save
    End With
End Sub

VBA Code - Auto Apply the Current View of a Folder to Its Subfolders

  1. Later, click into “Application_Startup” subroutine and press “F5” key to run this macro.
  2. Finally, you can have a try.
  • First off, select “Inbox” or “Sent Items” folder
  • Then, right click on the folder and choose “New Folder”.
  • Next, in the popup dialog box, specify a folder name and hit “OK”.Create a New Subfolder
  • After the folder is created, you can check it. Its view must be the same as its parent folder, namely “Inbox” or “Sent Items”.Same Folder View

Restore Compromised Outlook Data

Outlook file can be corrupt easily, which is nearly an admitted and unquestioned fact. Therefore, it is quite difficult and troublesome to safeguard Outlook data. At first, you have to insist on backing up your Outlook data files periodically. Besides, it is prudent to prepare remarkable and reliable Outlook repair software, such as DataNumen Outlook Repair. It can do what even the Inbox repair tool is unable to do, like restoring severely damaged Outlook PST data.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including SQL Server recovery and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.