How to mark a new mail as "Edited with my tool"

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

How to mark a new mail as "Edited with my tool"
Andrei Jugovic

Posts: 59
Joined: 2007-02-08

I am currently working on a tool that allows to specify different sets of options (e.g. "Mail is urgent and confidential") and to apply all option in such a set to a new mail with one button click.

I am planning to offer this tool as shareware with a trial- and registered full version. The trial version should work exactly like the full version but if the tool was used to apply some option to a mail some text should be added to mail like "This mail created using Tool XY - buy at" when the mail is sent.

So the trial version can be used for free but if the tool is used the mail contains some advertisement...

That the theory but I have no idea how the AddIn should know whether the tool was used during the creation of the mail or not.

Of course I could add the text to the mail when the Apply-Settings-Button is clicked. But in that case the user could easily delete the added text. So the text has to be added AFTER the user has clicked on "Send". But how can I know at this point in time if the tool was used or not?

Any idea how this can be solved?

Thank you very much!
Posted 15 Aug, 2007 10:19:50 Top

Posts: 10
Joined: 2007-01-07
Hi Andrei

Not sure if this is the best solution or not, but when the user clicks your button you could add a userproperty to the mailitem, and then once the send button is hit, check for your Userproperty and add your text to the body of the email if needed.


Posted 20 Aug, 2007 04:01:24 Top
Andrei Jugovic

Posts: 59
Joined: 2007-02-08
Hi David,

Thank you for the hint, that could be what I am looking for. I tried to add a new Userproperty to the MailItem:

newProperty := aMailItem.UserProperties.Add('MyProp', olText, false, false);
newProperty.Value := 'test';

This resaults in a Access Violation. Unfortunaltly I have found no Information about how to add an UserProperty to a MailItem in the documentation. Any idea how to do it correctly?
Posted 20 Aug, 2007 05:34:19 Top
Jason Coley

Posts: 272
Joined: 2005-05-26
Can you add a userproperty to an item that isn't saved first? Try saving it then try to add the property.
Posted 20 Aug, 2007 17:32:07 Top
Dmitry Kostochko

Add-in Express team

Posts: 2740
Joined: 2004-04-05
Hi Andrei,

newProperty := aMailItem.UserProperties.Add('MyProp', olText, false, false);

Try to pass the EmptyParam variable as the last parameter:

newProperty := aMailItem.UserProperties.Add('MyProp', olText, false, EmptyParam);

P.S. We always do our best to answer your forum requests as soon as possible. However, we apply the rule "first in first out" with Premium Support Service subscribers taking priority. Please understand it may take us some time to do research on the issue. Please be assured we will let you know as soon as the best possible solution is found.

Posted 29 Aug, 2007 09:57:20 Top