Solved

Out of Office assistant script

Posted on 2007-04-04
2
1,478 Views
Last Modified: 2008-09-30
I would like to set-up a script that turn the Out of Office assistant for someone,s else mailbox. The reason is some supervisor, when their employee don't come in, they often forget about setting their Out of Office and keep asking me to do it, so if I give them a small script it would ease the process.

0
Comment
Question by:MPAQUIN
2 Comments
 
LVL 3

Accepted Solution

by:
eshurak earned 250 total points
ID: 18853017
The Out of Office assistant is not available in VBA and if it was you would have some permissions issues  to deal with.

You can use CDO:

http://www.outlookcode.com/d/cdo.htm

http://groups.google.com/group/microsoft.public.outlook.program_vba/browse_thread/thread/398688f255d9cad0/e44b405864caaf34?lnk=st&q=out+of+office+vb&rnum=1&hl=en#e44b405864caaf34

Good luck
0
 

Expert Comment

by:Chromarty
ID: 22607462
Here is a VB script that uses CDO to manipulate OOF.  Works on a server with Exchange management tools installed and run as an account with full control over the target mailbox.

Dim mapiSession
Dim sMailbox
Dim sServer

strMailbox = "Username"
strServer = "ExServer"

Set mapiSession = CreateObject("MAPI.Session") mapiSession.Logon , , True, True, , , strServer & vbLf & strMailbox

If Err.Number = 0 Then
Wscript.Echo "Logged in!"
mapiSession.OutOfOffice = True
mapiSession.OutOfOfficeText = "I am out of Office."
Wscript.Echo  "OOF set!"
End If

mapiSession.Logoff
Set mapiSession = Nothing

Wscript.Echo "Logged off!"
0

Featured Post

How does your email signature look on mobiles?

Do your employees use mobile devices to reply to emails? With mobile becoming increasingly important to the business world, it is in your best interest to make sure that your email signature looks great across all types of devices.

Join & Write a Comment

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
This video discusses moving either the default database or any database to a new volume.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now