|
|
|
|
|
|
Outlook
|
Get status of out of office and set it to false (I'm present)
|
|
Ease of Use
|
Easy
|
Version tested with
|
2003
|
Submitted by:
|
Charlize
|
Description:
|
Switch the out of office status to false = I'm back. If status was false, nothing happens.
Out of Office assistant requires Exchange Server
|
Discussion:
|
Sometimes you need to leave your computer running for some specific tasks but you are not available. When you come back after a well deserved two days week-end, you could forget to turn the out of office assistant off. This coding can be used to autochange the status from true (assistant is used) to false by using some extra coding (not provided) that uses an on time event (this event is started when you turn your assistant on at Friday).
|
Code:
|
instructions for use
|
Sub test_out_of_office()
Dim oCDO As MAPI.Session
Dim oStore As MAPI.InfoStore
Dim oFolder As MAPI.Folder
Dim strStoreID As String
Dim blnOOF As Boolean
Set oCDO = CreateObject("MAPI.Session")
oCDO.Logon "", "", False, False
Set oFolder = oCDO.Inbox
strStoreID = oFolder.StoreID
Set oStore = oCDO.GetInfoStore(strStoreID)
blnOOF = oCDO.OutOfOffice
If blnOOF = False Then
MsgBox "Out Of Office is off."
Else
MsgBox "Out of Office in on."
oCDO.OutOfOffice = False
MsgBox "Out Of Office = " & oCDO.OutOfOffice
End If
End Sub
|
How to use:
|
- Create a new module in Outlook and paste this code
- Set a reference to cdo 1.21 (alt + f11 - extra - references)
-
- For Outlook 2007 - users. You need to download the cdo library and install it on the machine that you want to test this code on because this code requires a reference in the project to the Collaboration Data Objects (CDO 1.21) library. This is an optional component of Outlook 2003 and earlier versions and available as a separate download for Outlook 2007. See http://www.outlookcode.com/d/cdo.htm
- Download here:
- http://www.microsoft.com/downloads/details.aspx?FamilyID=2714320d-c997-4de1-986f-24f081725d36&displaylang=en
|
Test the code:
|
- Set your assistant on and run the code.
|
Sample File:
|
No Attachment
|
Approved by Jacob Hilderbrand
|
This entry has been viewed 101 times.
|
|