Add Icon/Checkbox/Hyperlink in folder item

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

Add Icon/Checkbox/Hyperlink in folder item
 
Md. Zahiduzzaman




Posts: 3
Joined: 2009-04-21
Is it possible to add Checkbox/Icon/Hyperlink in Folder item (eg mailitem in inbox) and handle click event for those?



Thanks
Zahid
Posted 21 Apr, 2009 13:03:14 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Zahid,

Generally, no. Outlook 2007 only allows showing the user property as a checkbox. Other variants are impossible.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Apr, 2009 13:44:54 Top
Md. Zahiduzzaman




Posts: 3
Joined: 2009-04-21
Hi Andrei,
Thanks for your quick response. Let me describe my requirements....

For each mail item in inbox i need to add user defined field. The field will show a check box. I also need to handle events for the check box (checked and unchecked).

What i did is.......

1. Manually added a user defined field in current view with type 'Yes/No' and format 'Yes/No'.

2. For each mail item added user property

// mailItem holds reference to a MailItem
UserProperty prop=
mailItem.UserProperties.Add("ColumnName",olUserPropertyType.olYesNo,false,Reflection.Missing.Value);
prop.Value="Yes";
mailItem.Save();


Nothing shows up in the Custom column, other than the column heading

And i found no way to attach event handler.

Can you provide a sample that adds a checkbox with/without ADX?

Thanks
Zahid

Posted 22 Apr, 2009 10:59:10 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Zahid,

Try
UserProperty prop= 
mailItem.UserProperties.Add("ColumnName",olUserPropertyType.olYesNo,true,Reflection.Missing.Value); 


And check the CustomPropertyChange event of the item.


Andrei Smolin
Add-in Express Team Leader
Posted 23 Apr, 2009 06:10:38 Top
Md. Zahiduzzaman




Posts: 3
Joined: 2009-04-21
Hi Andrei,

Thanks Again. I have modified a bit more ..

UserProperty prop= mailItem.UserProperties.Add("ColumnName",olUserPropertyType.olYesNo,true,4);
prop.value="True";

Here 4 is for olFormatYesNo.olFormatYesNoIcon

Now it works fine. But the check box is fixed. It can not be checked/Unchecked by the user. I think that's because outlook shows just an image of check box, its not a real one. and there is no way to attach event handler for the checkbox itself.

Thanks
Zahid
Posted 23 Apr, 2009 12:19:55 Top
Andrei Smolin


Add-in Express team


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

I assume this is by design; to change the checkbox state, you need to change the user property.

Add-in Express allows embedding a custom form to Outlook windows. For instance, you can show a form that displys some info related to the currently selected Outlook item(s).


Andrei Smolin
Add-in Express Team Leader
Posted 23 Apr, 2009 15:14:55 Top