Question : Creating Views in Outlook using VBA

I see from the Microsoft website that you can create a view in VBA ...

Public WithEvents objViews As Outlook.Views

Sub AddView()
    Dim myOlApp As New Outlook.Application
    Dim objView As Outlook.View
    Set objViews = myOlApp.ActiveExplorer.CurrentFolder.Views
    Set objView = objViews.Add("Latest View1", olTableView, olViewSaveOptionAllFoldersOfType)
End Sub

Sub objViews_ViewAdd(ByVal View As View)
'Displays name of new view

   With View
       Msgbox .Name & " was created programmatically."
       .Save
   End With

End Sub


But is it possible to specify the Filters, Automatic Formatting etc... for the view as well??

Hope so. Thanks.

Answer : Creating Views in Outlook using VBA

You can set the filters, I'm not sure about the automatic formatting. Here is the object model.

http://msdn.microsoft.com/en-us/library/bb176803.aspx

Random Solutions  
 
programming4us programming4us