Is it possible to make Outlook 2010 turn on the "Automatic Replies" feature when I close the application? I like to turn on "Out of Office" at the end of the day but in a hurry it's easily forgotten.
Answer
I REALLY tried to make this work for you, but I learned that Outlook 2010 no longer supports CDO 1.2.1, and not being a programmer, I did not have the deep knowledge to code it another way. Although unsupported and not recommended by Microsoft (why do they mention it then??), it is possible to install CDO if you have Outlook 2007, before you upgrade to Outlook 2010.
http://support.microsoft.com/kb/2028411
I am going to post how to do this in Outlook 2003/2007 in case anyone happens upon this. I just tested this. I will also post the other steps for Outlook 2010 ASSUMING YOU CAN FIX THE CODE.
For Outlook 2003/2007
For Outlook 2007 only, you must install CDO or the code will fail: http://www.microsoft.com/downloads/en/details.aspx?familyid=2714320d-c997-4de1-986f-24f081725d36&displaylang=en
Assuming your company's group policy does not override this, change the security in
Tools
→Macros
→Security
toNo Security Check for macros
.Go to
Tools
→Macros
→Visual Basic Editor
.Click on the Visual Basic icon, and hit F2 to open the objects browser.
In the new project in the left pane expand it until you see
ThisOutlookSession
and double-click it.Cut and paste the following code into the code window that just opened and save it:
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 SubClose and open Outlook.
It will give you a message about macros. Enable them.
For Outlook 2010
If you can fix the code, here are the steps for Outlook 2010. I include them because the locations of many items have changed, and could be hard to find. In the current code, I also point out the step that fails.
Assuming your company's group policy does not override this, change the security in
File
→Options
→Trust Center
→Trust Center Settings
→Macro Settings
toEnable all macros
.Start by enabling the
Developer
tab inFile
→Options
→Customize Ribbon
, checkDeveloper
in the right column.Click on the Visual Basic icon, and hit F2 to open the objects browser.
Go to
Classes
(left column) →ThisOutlookSession
and double-click it.Cut and paste the following code into the code window that just opened and save it:
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") THIS IS THE STEP THAT FAILS
objMAPISession.Logon , , True, False
objMAPISession.OutOfOffice = True
objMAPISession.Logoff
End If
Set objMAPISession = Nothing
End SubClose and open Outlook.
Go back to the
Developer
tab →Macros
icon. It will give you a message about macros. Enable them.
No comments:
Post a Comment