Thursday, October 29, 2009

How to set "Work Offline" for Outlook programatically

The show VBScript code snipppet will toggle between working "Offline" and "Online" for MS Outlook.

Set objOutlook = CreateObject("Outlook.Application")
objOutlook.GetNamespace("MAPI").Folders.GetFirst.GetExplorer.CommandBars.FindControl(, 5613).Execute
Set objOutlook = Nothing

Blog Archive