Autohotkey Outlook日历搜索

时间:2017-10-04 12:52:28

标签: autohotkey comobject

我试图弄清楚如何根据SubjectName搜索Autohotkey的特定约会。现在我正在努力展示最新的约会。



olFolderCalendar := 9   
olFolderContacts := 10 
olAppointmentItem = 1
                        
profileName := "Outlook"
Outlook := ComObjCreate("Outlook.Application")
namespace := Outlook.GetNamespace("MAPI")
namespace.Logon(profileName)  
calendar :=  namespace.GetDefaultFolder(olFolderCalendar)
items := calendar.Items
count := items.Count

msgbox % "calendar items: " count
item := calendar.Items(count)


item1 :=  "subject: " item.Subject . "`n"
item1 .=  "Start: " item.Start . "`n"
item1 .=  "Duration: " item.Duration . "`n"
item1 .=  "Body: " item.Body "`n"
msgbox % "item1" item1




提前致谢。

1 个答案:

答案 0 :(得分:0)

循环,寻找它:

olFolderCalendar := 9   
olFolderContacts := 10 
olAppointmentItem = 1

profileName := "Outlook"
Outlook := ComObjCreate("Outlook.Application")
namespace := Outlook.GetNamespace("MAPI")
namespace.Logon(profileName)  
calendar :=  namespace.GetDefaultFolder(olFolderCalendar)
items := calendar.Items
count := items.Count

msgbox % "calendar items: " count

InputBox, testsubj, What Subject?, What Subject?
Loop {
    item := calendar.Items(count - A_Index + 1)
    subj := item.Subject
    IfEqual, subj, %testsubj%
        break
}

item1 :=  "subject: " item.Subject . "`n"
item1 .=  "Start: " item.Start . "`n"
item1 .=  "Duration: " item.Duration . "`n"
item1 .=  "Body: " item.Body "`n"
msgbox % "item1" item1

H个,