From: Steve Tuckner Date: 2003-06-27T00:54:03+09:00 Subject: [WIN32OLE] Outlook Automation Question This is a multi-part message in MIME format. ------=_NextPart_000_00BC_01C33BD1.368279B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I am running a script to grab emails out of my Outlook email box. I want to grab ones that I have flagged and then I want to clear the flag however, the following code doesn't work. It seems to read the flag status just fine (it looks like 0 means no flag, 1 means cleared flag, and 2 means flagged). Any ideas? Steve Tuckner ------- Code ------------------- outlook = WIN32OLE.new("Outlook.Application") namespace = outlook.GetNamespace("MAPI") class OutlookConst end WIN32OLE.const_load(outlook, OutlookConst) folder = namespace.GetDefaultFolder(OutlookConst::OlFolderInbox) i = 0 folder.items.each do |item| if (item.FlagStatus == 2) then item.FlagStatus = 1 end end ------=_NextPart_000_00BC_01C33BD1.368279B0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I am = running a=20 script to grab emails out of my Outlook email box. I want to grab ones = that I=20 have flagged and then I want to clear the flag however, the following = code=20 doesn't work. It seems to read the flag status just fine (it looks like = 0 means=20 no flag, 1 means cleared flag, and 2 means flagged). Any=20 ideas?
 
Steve = Tuckner
 
------- Code=20 -------------------
 
outlook =3D=20 WIN32OLE.new("Outlook.Application")
namespace =3D=20 outlook.GetNamespace("MAPI")
 
class = OutlookConst
end
 
WIN32OLE.const_load(outlook, OutlookConst)
 
folder =3D=20 namespace.GetDefaultFolder(OutlookConst::OlFolderInbox)
i =3D = 0
folder.items.each do |item|
 if (item.FlagStatus =3D=3D 2) = then
  item.FlagStatus =3D=20 1
 end
end
------=_NextPart_000_00BC_01C33BD1.368279B0--