Mark some mail as special only for plugin

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

Mark some mail as special only for plugin
 
Giancarlo




Posts: 67
Joined: 2016-08-17
I understood Handle events of Outlook Items object at https://www.add-in-express.com/docs/vcl-outlook-addins.php.

I saw that I can access to all mail: comfortable.
I have a doubt.
My inbox contains more than 3,000 email
I know people who have more than 10,000 email

I'm trying to mark a few mails, such as special.
(Only for the plugin, No for people)

Later I have to find them and work them.

I have 2 questions:
1) there is a field to record some of my settings?
For example:

Mail.Note := 'special';


2) how can I find them quickly?
Posted 09 Sep, 2016 04:02:04 Top
Giancarlo




Posts: 67
Joined: 2016-08-17
I'm looking for an example in Delphi like this

https://www.add-in-express.com/forum/read.php?FID=1&TID=4993


I have yet to understand how to add custom property
Posted 09 Sep, 2016 05:33:51 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Hello Giancarlo,

Your ways are:
- add a UserProperty object; see https://www.add-in-express.com/forum/read.php?FID=1&TID=2483
- add a custom named property using PropertyAccessor object (see e.g. https://social.msdn.microsoft.com/Forums/vstudio/en-US/08ecce0a-be0a-4d42-9bbd-7d1691b8abde/using-propertyaccessor-to-set-and-get-properties-in-a-meeting-request?forum=vsto and https://msdn.microsoft.com/en-us/library/office/gg262881(v=office.14).aspx)

As to searching emails marked with a property, see https://msdn.microsoft.com/en-us/library/cc513841(v=office.12).aspx.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Sep, 2016 05:35:29 Top
Giancarlo




Posts: 67
Joined: 2016-08-17
In the first procedure i add the property to e-mail in this way:

FMail: TMailItem;
FMail.UserProperties.Add('MyProp', olText, false, false).Value := 'test';
FMail.Save;


In the second procedure, i search the e-mail in this way:


ItemsEvents: TItems;
Item: IDispatch;
...
ConnectToFolderByIndex(ItemsEvents, 3);
...
Item := ItemsEvents.Find('[MyProp] = ''test''');


but i got this error:
add-in has fired an exception
Property "MyProp" unknow
Posted 09 Sep, 2016 07:49:47 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Giancarlo writes:
UserProperties.Add('MyProp', olText, false, false)


Try passing true in the AddToFolderFields parameter; see https://msdn.microsoft.com/en-us/library/office/ff867389(v=office.15).aspx.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Sep, 2016 07:53:34 Top