Posts Tagged vbscript
Modify Outlook 2007 View by using vbscript (vbs)
Posted by Victor Tong in Exchange Server, MS Office on September 20th, 2009
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:
http://msdn.microsoft.com/en-us/library/bb177050.aspx
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. objTableView.Save objTableView.Apply 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" Next objView.Save objView.Apply wscript.echo "Completed"
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
SAPI vbscript example
Posted by Victor Tong in Windows Infrastructure on June 22nd, 2009
This VBScript example provides a simple text-to-speech demonstration by using SAPI and VBScript.
Very interesting
Download this text file and rename it to SAPI_Speak.vbs.
Double click and run it. Your computer will speak out what you have entered.
* Remember to turn on your speaker.
File: SAPI_Speak.txt
'******************************************** '* Windows SAPI VBScript Example '* Author: Victor Tong '* Website: www.0101news.com '* Last Update: 22 June, 2009 '******************************************** Dim message, sapi message=InputBox("Enter a string that you want SAPI to speak") Set sapi=CreateObject("sapi.spvoice") sapi.Speak messageTotal views: 23,161 views
Comments