Outlook: Flagging emails, the sequel...

Get help with using AutoHotkey and its commands and hotkeys
andrewvanmarle
Posts: 15
Joined: 08 Jul 2019, 07:58

Outlook: Flagging emails, the sequel...

31 Jan 2020, 06:59

Hi All,

I use the code below to mark mails in outlook as complete, flagged (today), flagged (tomorrow) and remove flags. (if you use outlook, then this is almost a must)

I want to refine this a bit and add two more buttons:
Flag next week
and
flag next monday


Flag next week is something that exists within OUtlook, but i'm not sure how to call on that. :oops:


Flag next monday will be more complicated I guess, but one can try..... :crazy:


Anyone have ideas, want to help?

Thanks! :D

Code: Select all

F1:: ; olFlagComplete
        Outlook := ComObjActive("Outlook.Application")	
        Selection := Outlook.ActiveExplorer.Selection
	Item := Selection.Item(1)
	Item.FlagStatus := 1
	Item.Save
	Outlook := ""
return



F2::
	tm := A_Now
	tm += 0, Days
	FormatTime, tm, % tm, MM/dd/yyyy h:mm
	Icon := 0 ;olMarkToday
	Subject := "Hello"
	Outlook := ComObjActive("Outlook.Application")
	Item := Outlook.ActiveExplorer.Selection.Item(1)
	Item.MarkAsTask(Icon)
	Item.TaskStartDate := tm
	Item.TaskDueDate := tm
	Item.TaskSubject := Subject
	Item.FlagRequest := Subject
	Item.ReminderTime := tm
	Item.ReminderSet := 0 ;true
	Item.Save
	Outlook := Item := "" ;clear ALL COM objs
return

F3::
	tm := A_Now
	tm += 1, Days
	FormatTime, tm, % tm, MM/dd/yyyy h:mm
	Icon := 1 ;olMarkTomorrow
	Subject := "Hello"
	Outlook := ComObjActive("Outlook.Application")
	Item := Outlook.ActiveExplorer.Selection.Item(1)
	Item.MarkAsTask(Icon)
	Item.TaskStartDate := tm
	Item.TaskDueDate := tm
	Item.TaskSubject := Subject
	Item.FlagRequest := Subject
	Item.ReminderTime := tm
	Item.ReminderSet := 0 ;true
	Item.Save
	Outlook := Item := "" ;clear ALL COM objs
return


F4:: ; olNoFlag
        Outlook := ComObjActive("Outlook.Application")
	Selection := Outlook.ActiveExplorer.Selection
	Item := Selection.Item(1)
	Item.FlagStatus := 0
	Item.Save
	Outlook := ""
return
[Mod edit: Provisional topic name added.]
LOL, im an idiot for forgetting a subject, thanks mods!

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], brotherS, Google [Bot], paulcopeland, poetbox, vsub and 101 guests