부재중을 끄거나 켜기 위해 Outlook이 열거나 닫을 때 메시지를 표시하도록 하는 매크로

부재중을 끄거나 켜기 위해 Outlook이 열거나 닫을 때 메시지를 표시하도록 하는 매크로

Outlook 2007을 종료할 때 부재 중 알림을 켤 것인지 묻는 매크로를 Outlook 2007에 추가하고, Outlook을 열 때 부재 중 알림을 끌 것인지 묻는 매크로를 추가하고 싶습니다. 닫을 때 프롬프트를 생성하는 방법에 대한 지침을 찾았습니다(Outlook 2010: Outlook을 닫을 때 부재 중을 자동으로 켜는 방법은 무엇입니까?그리고http://itknowledgeexchange.techtarget.com/itanswers/automating-out-of-office/) 하지만 열 때 프롬프트에 대한 매크로를 작성하는 방법을 모르겠습니다.

답변1

여기를 보아라 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

고객님께서 관심을 가져주시는 부분입니다.

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 

"Outlook 2010에서는 코드를 테스트하지 않았습니다."라는 메모가 있습니다.

또한 "컴퓨터에 CDO(Collaboration Data Objects)가 설치되어 있어야 합니다. CDO가 설치되어 있지 않은 경우 이 Microsoft 페이지에서 다운로드할 수 있습니다."

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

관련 정보