Modify Outlook 2007 View by using vbscript (vbs)

Currently I am checking how to modify Outlook 2007 default view by using vbs.

Following is my working vbs. You can download and test it.

MSDN reference:

VBS code example

Const ForReading = 1
Const olFolderInbox = 6
Const olColorRed = 10
Set olApp = CreateObject("Outlook.Application")
Set objName = olApp.GetNameSpace("MAPI")

Set objTableView = objName.GetDefaultFolder(olFolderInbox).CurrentView

            objTableView.ColumnFont.Size = 10
            objTableView.ColumnFont.Name = "Arial"

            objTableView.RowFont.Size = 10
            objTableView.RowFont.Name = "Arial"

            objTableView.AutoPreviewFont.Name = "Arial"
            objTableView.AutoPreviewFont.Size = 10

            ' Save the table view.

        Set objView = objName.GetDefaultFolder(olFolderInbox).CurrentView

        For Each objRule In objView.AutoFormatRules

           If Not objRule.Name = "Unread group headers" Then

                'MsgBox objRule.Name
		'MsgBox objRule.Font.Color

                objRule.Font.Color = olColorRed

           End If
           objRule.Font.Size = 10
           objRule.Font.Name = "Arial"



wscript.echo "Completed"

Outlook 2007 default view

Outlook 2007 default view

Outlook 2007 default view

After running vbs, it makes the following change
1. Font changed from Segoe to Arial
2. Font size changed to 10pt
3. Unread mail changed from black to red

After running vbs, modified Outlook view

After running vbs, modified Outlook view

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.18_1163]
Rating: 0 (from 0 votes)
Total views: 24,045 views

, , , ,

  1. #1 by Chuck Murry on May 24th, 2010

    My boss is asking me to do exactly what you’ve done here. He wants me to change the text of unread messages to red. Can you explain how I insert this script and get it working. I have 2008 SBS server x64 running Microsoft Exchange 2007. Thank you for your time.

    VA:F [1.9.18_1163]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.18_1163]
    Rating: 0 (from 0 votes)
(will not be published)

  1. No trackbacks yet.