Mark as read

Add-in Express™ Support Service
That's what is more important than anything else

Mark as read
 
Karim




Posts: 170
Joined: 2006-01-02
Hi,

I try to mark messages as 'read'. i Try setting the property of the _MailItem interface unread property to false but it doesn't work.Please can you make me a simple example.

Thanks

I use Delphi XE2

Karim
Posted 26 Nov, 2012 08:00:08 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Karim,

var
  theExplorer:Explorer;
  IMail:_MailItem; sel: Selection;
begin
  theExplorer := OutlookApp.ActiveExplorer;
  if theExplorer <> nil then
  begin
    try
      sel := theExplorer.Selection;
    except
    end;
    if sel <> nil then begin
      IMail := sel.Item(1) as _MailItem;
      if IMail <> nil then begin
        ShowMessage('It works');
        IMail.UnRead := not IMail.UnRead;
      end;
    end;
  end;
end;



Andrei Smolin
Add-in Express Team Leader
Posted 26 Nov, 2012 09:15:20 Top
Karim




Posts: 170
Joined: 2006-01-02
It works very well.
Thank you for you help !!!
Posted 26 Nov, 2012 09:46:46 Top