Autohotkey Outlook 日历搜索

Autohotkey Outlook Calender Search

我正在尝试弄清楚如何根据 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

提前致谢。

遍历,寻找:

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

Hth,