macro para que Outlook me solicite abrir/cerrar para activar/desactivar Fuera de la oficina

macro para que Outlook me solicite abrir/cerrar para activar/desactivar Fuera de la oficina

Me gustaría agregar una macro a Outlook 2007 que me pregunte cuando lo apago si quiero activar el Asistente para fuera de la oficina y luego me pregunte cuando abro Outlook si quiero desactivar el Asistente para fuera de la oficina. Encontré instrucciones para crear el mensaje al cerrar (enOutlook 2010: ¿Cómo activar Fuera de la oficina automáticamente cuando se cierra Outlook?yhttp://itknowledgeexchange.techtarget.com/itanswers/automating-out-of-office/) pero no sé cómo escribir una macro para el mensaje al abrir.

Respuesta1

Mira aquí http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/A_3487-Automating-Out-of-Office-in-Outlook.html

Private Sub Application_Quit()
    OutOfOffice True
End Sub

Esta es la parte que te interesa.

Private Sub Application_Startup()
    OutOfOffice False
End Sub

Sub OutOfOffice(bolState As Boolean)
Const PR_OOF_STATE = "http://schemas.microsoft.com/mapi/proptag/0x661D000B"
Dim olkIS As Outlook.Store, olkPA As Outlook.PropertyAccessor
For Each olkIS In Session.Stores
    If olkIS.ExchangeStoreType = olPrimaryExchangeMailbox Then
        Set olkPA = olkIS.PropertyAccessor
        olkPA.SetProperty PR_OOF_STATE, bolState
    End If
Next
Set olkIS = Nothing
Set olkPA = Nothing
End Sub 

Hay una nota "no se probó el código con Outlook 2010".

Además, "CDO (Collaboration Data Objects) debe estar instalado en la computadora. Si descubre que CDO no está instalado, puede descargarlo desde esta página de Microsoft".

http://www.microsoft.com/downloads/details.aspx?familyid=2714320d-c997-4de1-986f-24f081725d36&displaylang=en

información relacionada