Copy Folder Views

With VBA you can copy the view settings for one folder to another folder.

Last modified: 2006/05/05 | Accessed: 61.843  | #25
◀ Previous sample Next sample ▶
ReplyAll ReplyAll
ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the e-mail.

In Outlook you can create views of your own. While it's not possible to copy or inherit views, you can do that with a few lines of VBA code since Outlook XP. The sample asks once for the folder with the view that you want to copy, then it asks for the destination folders until you click cancel.

tip  How to add macros to Outlook
Public Sub CopyView()
  Dim SourceFolder As Outlook.MAPIFolder
  Dim TargetFolder As Outlook.MAPIFolder

  Set SourceFolder = Application.Session.PickFolder

  If Not SourceFolder Is Nothing Then

    Set TargetFolder = Application.Session.PickFolder

    While Not TargetFolder Is Nothing
      If TargetFolder.DefaultItemType = SourceFolder.DefaultItemType Then

        With TargetFolder.CurrentView
          .xml = SourceFolder.CurrentView.xml
        End With

        MsgBox "Source and target folder must be of the same type.", vbInformation
      End If

      Set TargetFolder = Application.Session.PickFolder
  End If
End Sub
Category-Manager Category-Manager
With Category-Manager you can group your Outlook categories, share them with other users, filter a folder by category, automatically categorize new emails, and more. You can use the Addin even for IMAP.
email  Send a message