15 pts.
 Automating Outlook Out of Office
is it possible to automate the out of office function as i job share and am only in the office 3 days a week, so emails that come in from anyone automatically get the out of office message without me having to set the out of office each week. (In case I forget to set it) Thanks

Software/Hardware used:
ASKED: March 23, 2009  10:45 PM
UPDATED: November 11, 2011  5:26 PM

Answer Wiki:
I found some Visual Basic Application code that you can use to automate when you close outlook to display an out of message reply. Here is the code: Private Sub Application_Quit() Dim objMAPISession As Object Set objReminders = Nothing If MsgBox("Would you like to turn the Out of Office Assistant on?", vbYesNo, "Activate Out of Office Assistant") = vbYes Then Set objMAPISession = CreateObject("MAPI.Session") objMAPISession.Logon , , True, False objMAPISession.OutOfOffice = True objMAPISession.Logoff End If Set objMAPISession = Nothing End Sub Here are the instructions to get this going: 1. Open up Outlook. 2. Click Tools->Macros->Visual Basic Editor. 3. If not already expanded, expand Microsoft Office Outlook Objects and select ThisOutlookSession. 4. Copy the code and paste it into the right-hand pane of the VB editor. 5. Click the diskette icon on the toolbar to save the code. 6. Close the VB editor. 7. Click Tools->Macros->Security. 8. Change the security level to Medium. 9. Click Ok. 10. Close Outlook. 11. Start Outlook. 12. You'll receive a dialog-box telling you that ThisOutlookSession contains macros and asking if you want to enable them. Click Enable Macros. 13. Try closing Outlook. When you do a dialog-box should appear asking if you want to turn the Out of Office Assistant on. If you click Yes it will be turned on. Clicking No will leave it off.
Last Wiki Answer Submitted:  March 24, 2009  2:36 pm  by  Karl Gechlik   9,815 pts.
All Answer Wiki Contributors:  Karl Gechlik   9,815 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

what mail software (client and server) are you using ?

 63,535 pts.

 

I expect you are using outlook. What version and service pack level please?

 56,975 pts.

 

Hi yeah Microsoft Outlook 2007 – I believe it’s SP1.
Cheers

 15 pts.

 

Karl, what a great solution, thanks for posting that!

 56,975 pts.

 

simple but useful

nice one chap!

 10 pts.

 

This doesn’t appear to be working in Outlook 2007. I receive a Run-time error on Set objMAPISession = CreateObject(“MAPI.Session”).

Any suggestions?

Thanks!

 10 pts.

 

Hi All,

For the above code to work in Outlook 2007 try installing the package at http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3671. This should solve the problem for run time errors during the code execution.

Thanks,
Pappu.

 10 pts.

 

What should the code be when you have Application_Start()? Need something to run when they turn outlook on and when they logoff.

 10 pts.