Hello,
I found this snippet that changes the subject line on ONE selected email in Outlook2016:
tell application "Microsoft Outlook"
set objMessage to item 1 of (get current messages)
set dlgReply to display dialog "Subject:" default answer (get subject of objMessage) with icon 1
if text returned of dlgReply is not "" then
set subject of objMessage to text returned of dlgReply
end if
end tell
I want to adapt it to change MULTIPLE selected emails. The following doesn’t work! Does anyone have an idea what it would take fix it, and why?
tell application "Microsoft Outlook"
set objMessage to item 1 of (get current messages)
set dlgReply to display dialog "Subject:" default answer (get subject of objMessage) with icon 1
if text returned of dlgReply is not "" then
repeat with i from 1 to the (count of (get current messages))
set objMessage to item i of (get current messages)
set subject of objMessage to text returned of dlgReply
end repeat
end if
end tell
Thanks!
Cyan