Outlook2010のVBAで会議通知を自動返信するコードを書いているのですが、動く時と動かない時があり原因を調べているのですが、発生条件などがわからず困っています。
どなたかヒントをいただけませんでしょうか?
###【問題点1】
Outlookを起動していない時に受信した会議通知に対して応答がされない。
※Outlookはバッチを利用して、タスクスケジューラで時々起動しています。
※テキストファイルへの書き込みも実施されないのでそもそも動いていない???
###【問題点2】
キャンセル通知を受信した際、予定表に「Canceled」と書き込まれるが、本当はキャンセル応答を自動で返し予定表から削除させたいが出来ない。
###【コード】
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim tmpItem Dim buf Dim i Open "C:\log.txt" For Output As #1 buf = Split(EntryIDCollection, ",") Print #1, Now For i = LBound(buf) To UBound(buf) Print #1, i Set tmpItem = Application.Session.GetItemFromID(buf(i)) If tmpItem.MessageClass = "IPM.Schedule.Meeting.Request" Then Set tmpAppoint = tmpItem.GetAssociatedAppointment(True) Set tmpMeeting = tmpAppoint.Respond(olResponseAccepted, True) tmpMeeting.Send ElseIf tmpItem.MessageClass = "IPM.Schedule.Meeting.Resp.Neg" Then Set tmpAppoint = tmpItem.GetAssociatedAppointment(False) tmpAppoint.MeetingStatus = olMeetingCanceled tmpAppoint.Send tmpAppoint.Delete End If Next Close #1
End Sub

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/03/20 13:57
2016/03/21 04:53