Solved

Out of Office assistant script

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

840 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