have you worked out how to do it from within VBA? i would advise opening up outlook and the visual basic editor and then using the object browser and searching for 'views'
once you have the code in VBA you can perhaps try and port it into vbscript, if you really need to run it from there
Using the Views collection
Use the Views property of the MAPIFolder object to return the Views collection. Use Views.Item(index),where index is the object's name or position within the collection, to return a single View object. The following example returns a View object of type olTableView called Table View. Before running this example, make sure a view by the name 'Table View' exists.
Sub GetView()
'Returns a view called Table View
Dim olApp As Outlook.Application
Dim objName As NameSpace
Dim objViews As Views
Dim objView As View
Set olApp = Outlook.Application
Set objName = olApp.GetNamespace("MAPI")
Set objViews = objName.GetDefaultFolder(olFolderInbox).Views
'Return a view called Table View
Set objView = objViews.Item("Table View")
End Sub
Use the Add method of the views collection to add a new view to the collection. The following example adds a new view of type olIconView in the user's Notes folder.
Note The Add method will fail if a view with the same name already exists.
Sub CreateView()
'Creates a new view
Dim olApp As Outlook.Application
Dim objName As NameSpace
Dim objViews As Views
Dim objNewView As View
Set olApp = Outlook.Application
Set objName = olApp.GetNamespace("MAPI")
Set objViews = objName.GetDefaultFolder(olFolderNotes).Views
Set objNewView = objViews.Add(Name:="New Icon View Type", _
ViewType:=olIconView, SaveOption:=olViewSaveOptionThisFolderEveryone)
End Sub
Use the Remove method to remove a view from the collection. The following example removes the above view, "New Icon View Type", from the collection.
Sub DeleteView()
'Deletes a view from the collection
Dim olApp As Outlook.Application
Dim objName As NameSpace
Dim objViews As Views
Dim objNewView As View
Set olApp = Outlook.Application
Set objName = olApp.GetNamespace("MAPI")
Set objViews = objName.GetDefaultFolder(olFolderNotes).Views
objViews.Remove ("New Icon View Type")
ok i have been playing around with some things, and it works, BUT it only works for the inbox folder and not all folders of the same type
code:
----------------------------------------------------------------
Sub NewView()
'Creates a new view and modifies its properties.
'Accepts 1 or 2 element names and their values.
'The second element and value are optional.
Dim objViews As Views
Dim objView As View
'Set a reference to the MSXML type library.
Dim objXML As New MSXML2.DOMDocument
Dim objXMLNode As MSXML2.IXMLDOMNode
Set objViews = Outlook.Application.GetNamespace(Type:="MAPI").GetDefaultFolder(FolderType:=olFolderInbox).Views
Set objView = objViews.Add(Name:="New View", ViewType:=olTableView, SaveOption:=olViewSaveOptionAllFoldersOfType)
'Load the schema into the MSXML parser.
objXML.loadXML bstrXML:=objView.XML
'Select the node you want to modify and assign a new value.
Set objXMLNode = objXML.selectSingleNode(querystring:="view/arrangement/autogroup")
objXMLNode.nodeTypedValue = "0"
'Check if optional input values exist; if so, change settings.
Set objXMLNode = objXML.selectSingleNode(querystring:="view/previewpane/visible")
objXMLNode.nodeTypedValue = "0"
'Copy the modified XML back to the new view.
objView.XML = objXML.XML
'Save and apply the new view.
objView.Save
objView.Apply
End Sub
----------------------------------------------------------------
AntunB, you might check out the Tech Republic article concerning the "/cleanviews" command line switch for Outlook 2003. The article is at the web link:
I'm not sure if it will solve your problem concerning Office rollout because the article mentions placing "/cleanviews" in the shortcut parameters for the Outlook shortcut. Additionally, their procedure requires about 13 or more steps.
The article has a link to another site about how to turn off the Reading Pane and Grouping (
While digging through the articles I recommended, the second article has a link to the following page which explains alot more about Outlooks command line switches:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.