Solved

Out of Office assistant script

Posted on 2007-04-04
2
1,489 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't know how to downgrade, my instructions below should be helpful.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
This video discusses moving either the default database or any database to a new volume.

932 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

10 Experts available now in Live!

Get 1:1 Help Now