Question : Outlook 2007 Out of Office

Is there a way to turn on the old style out of office notification popup in outlook 2007?

instead of it just displaying in the bottom corner?

Answer : Outlook 2007 Out of Office

Here's the code for doing this.  Follow these instructions to use it.

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
5.  Edit the code as needed.  I included comment lines wherever something needs to or can change
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Click Tools > Trust Center
9.  Click Macro Security
10. Set Macro Security to "Warnings for all macros"
11. Click OK
12. Close Outlook
13. Start Outlook.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.

Here's how this works.  Each time Outlook starts it fires the Application_Startup event.  Any code in that event handler runs.  In this case, it calls the routine to check OOF.  The subroutine CheckOOFState runs and checks to see if out of office is turned on.  If it is, then it displays a dialog box in the middle of the screen letting the user know it's on and asking if they want to trun it off.  If they click the Yes button, then it the message is turned off.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
Private Sub Application_Startup()
    CheckOOFState
End Sub
 
Sub CheckOOFState()
    Const PR_OOF_STATE = "http://schemas.microsoft.com/mapi/proptag/0x661D000B"
    Dim olkIS As Outlook.Store, olkPA As Outlook.PropertyAccessor, bolOOF As Boolean, varChoice As Variant
    For Each olkIS In Session.Stores
        If olkIS.ExchangeStoreType = olPrimaryExchangeMailbox Then
            Set olkPA = olkIS.PropertyAccessor
            bolOOF = olkPA.GetProperty(PR_OOF_STATE)
            Exit For
        End If
    Next
    If bolOOF Then
        'Edit the message as you see fit.'
        varChoice = MsgBox("Out of Office is turned on.  Do you want to turn it off?", vbInformation + vbYesNo + vbApplicationModal, "Out of Office Reminder")
        If varChoice = vbYes Then
            olkPA.SetProperty PR_OOF_STATE, False
        End If
    End If
    Set olkIS = Nothing
    Set olkPA = Nothing
End Sub
Random Solutions  
 
programming4us programming4us