2016-06-23 2 views
-1

해당 시간에 모임이 있는지 여부에 따라 Outlook에서 모임 요청을 수락하거나 미정 수락합니다. 나는 규칙을 세웠다. 내가 아는 한 VBA를 실행하지만 코드가 작동하지 않습니다. 문제를 찾을 수 없습니다.자동 수락/자동 수락

Sub AcceptDecline(oRequest As MeetingItem) 

If oRequest.MessageClass <> "IPM.Schedule.Meeting.Request" Then 
    Exit Sub 'if this messageclass isn't a meeting request 
End If 

Dim oAppt As AppointmentItem 
Set oAppt = oRequest.GetAssociatedAppointment(True) 

Dim myAcct As Outlook.Recipient 
Dim myFB As String 

Set myAcct = Session.CreateRecipient("[email protected]") 

myFB = myAcct.FreeBusy(oAppt.Start, 5, False) 'gets the free or busy status of my calendar 

Dim oResponse 
Dim i As Long 
Dim test As String 

i = (TimeValue(oAppt.Start) * 288) 
test = Mid(myFB, i - 2, (oAppt.Duration/5) + 2) 

If InStr(1, test, "1") Then 
    Set oResponse = oAppt.Respond(olMeetingTentative, True) 
    oResponse.Display 
    oResponse.Send 

Else 
    Set oResponse = oAppt.Respond(olMeetingAccepted, True) 
    oResponse.Display 
    oResponse.Send 
End If 
End Sub 
+0

코드를 디버깅 했습니까? –

+0

@ Nathan_Sav 나는 내가 어떻게 ...이 질문을 발견했는지 모른다는 것을 두려워한다. (http://stackoverflow.com/questions/5029141/debugging-an-outlook-2007-script-fired-by-a -rule)하지만 MeetingItem 매개 변수를 삽입하는 방법은 설명하지 않으며 개체를 만들 수없는 것으로 보입니다 ([this ref] (https://msdn.microsoft.com/en-us/library/office)를 참조하십시오. /ff868714.aspx)) – RhysO

+0

중단 점을 사용하고 Google에서 빠른 모양을 유지합니다. 나는 비슷한 것을 triesd, 그래서 이것에 대한 답변을 확인해보십시오 http://stackoverflow.com/questions/32974269/get-meeting-time-when-accepting-meeting –

답변

1

미팅 요청이 임시로 수락 된 모임을 만들면 약속 있음/없음은 현재 사용 중이라는 것을 나타냅니다. 응답은 항상 잠정 수락됩니다.

파일 -> 옵션 -> 분과 구분> 추적 -> 비활성화 : 그 문제가 그 요청을 열 수없는 경우 자동으로 요청과 여론 조사

https://www.msoutlook.info/question/do-not-automatically-accept-meeting-as-tentative

을 만나기를 요청과 응답을 충족 처리하는 자동으로 미정이라고 표시되지 않고 다음을 통해 단계별로 수행하십시오.

Private Sub AcceptDecline_test() 
    AcceptDecline ActiveInspector.currentItem 
End Sub 
관련 문제