Recurring icon for custom form task item

Status
Not open for further replies.

mcwiciu

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hello! Greetings :)

I need help!

I've created a custom task form (IPM.Task.Zadanie) from default task form (IPM.Task), changed icons in properties tab - large and small - to task icons found in Program Files\Microsoft Office\Office12\FORMS\1045 folder (TASKL.ICO and TASKS.ICO - i use Outlook 2007) and published custom form to personal form library. I made my new custom form for tasks (IPM.Task.Zadanie) default to my personal task folder. I also changed class of every task item in task folder to new one (IPM.Task.Zadanie).

Icons are displayed correctly with one exception - task items that are recurring task items should display task icon with two arrows in right bottom corner (this indicates that this item has recurrence). Now recurring items have the same icon like task items without recurrence (i know that i can add column to show recurrence but this doesn't solve the problem).

So my question is - how force Outlook to show recurring task items (with class IPM.Task.Zadanie) with icon that contains arrows (like default one).

Look forward for reply

Thx in advance
 

mcwiciu

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hello again.

I made some progress but still its not what i really need.

I registered form region in windows registry, specified the message class, made xml schema:

<FormRegion xmlns="http://schemas.microsoft.com/office/outlook/12/formregion.xsd">
<formRegionType>replace</formRegionType>
<icons>
<default>c:\Form Regions\olkfst.ico</default>
<recurring>c:\Icons\recur.ico</recurring>
</icons>
</FormRegion>

Icon for custom class form (IPM.Task.Zadanie) tasks has changed, but is the same for non-recurring and recurring items. New icon (olkfst.ico) as specified in xml schema under <default> child element appear for all items without distinction between recurring and non-recurring items. For recurring items it should be recur.ico as specified in xml schema under <recurring> child element, but its not. It looks like there are no recurring tasks, but there is a lot of recurring tasks in my personal tasks folder. Only difference now is that the icon has changed, but without distinction between recurring and non-recurring items.

Any ideas?

Greetings and thx in advance.
 

mcwiciu

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Continued exploration ...

I finally got what I wanted, but it's a little bit freaky.

At first, i know what is the issue of problems.

I used DocMessageClass and changed class of items with matched option "Reset icons".

That changed Property PR_ICON_INDEX to -1 (it allows to display custom items but causes my problems). I used Outlook Spy to determine this. Property PR_ICON_INDEX is set to -1 also in items created via custom forms (with custom class - for ex. IPM.Task.zadanie).

To avoid that i created custom form IPM.Task.zadanie (i replaced first page of IPM.Task with form region - it looks almost like default one). I made it default for my task folder. Then i deleted custom form from library (but it is still default for my task folder. When I create new tasks - new tasks are IPM.Tasks.zadanie -> I registered form region in windows registry, specified the message class (IPM.Task.zadanie), made xml schema (previous post). Now when i create new item everythings works fine.

But there is one more thing and I need help.

I want to change my task items back to default PR_ICON_INDEX property (for ex. it is 1280 for non-recurring task items and 1281 for recurring). It is possible do that one by one with Outlook Spy but i've got many many task items. It is too much work and would take too much tiime i dont have.

I found macro, which change PR_ICON_INDEX property, but it doesn't change all selected items at once (only first one from selection). Macro code is (http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_26716151.html):

Sub ChangeIcon()
Const PR_ICON_INDEX = "http://schemas.microsoft.com/mapi/proptag/0x10800003"
Dim olkMsg As Outlook.MailItem, olkPA As Outlook.PropertyAccessor
Set olkMsg = Application.ActiveExplorer.Selection(1)
Set olkPA = olkMsg.PropertyAccessor
olkPA.SetProperty PR_ICON_INDEX, 0
olkMsg.Save
Set olkPA = Nothing
Set olkMsg = Nothing
End Sub

It works well, but I have to change each element separately (I even created button for macro but still too much clicking).

I am not a programmer so my request is:

help me change this macro code that it will change all items at once (when i select folder or items in folder - doesn't matter).

Thx in advance and greetings.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
This: Set olkMsg = Application.ActiveExplorer.Selection(1) tells it to use the selected item. I have a generic macro to work with all items in any folder here - http://www.slipstick.com/developer/code-samples/working-items-folder-selected-items/
and merge your code into it. You'll need to replace obj with olkMsg then put your code within the for/next loop

For Each olkMsg In objItems
With olkMsg
Set olkPA = olkMsg.PropertyAccessor
olkPA.SetProperty PR_ICON_INDEX, 0
olkMsg.Save
end with
Next
 

mcwiciu

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I made sth like this but it doesn't seem to work (i got message box "invalid procedure code or argument")... (I replaced line "Dim obj As Object" with "Dim olkMsg As Object", then put code within the for/next loop and replaced "Set obj = Nothing" to "Set olkMsg = Nothing")

Public Sub PR_ICON_INDEX_change_many_items()
Dim objOL As Outlook.Application
Dim objItems As Outlook.Items
Dim objFolder As Outlook.MAPIFolder
Dim olkMsg As Object


Set objOL = Outlook.Application
Set objFolder = objOL.ActiveExplorer.CurrentFolder
Set objItems = objFolder.Items

For Each olkMsg In objItems
With olkMsg
Set olkPA = olkMsg.PropertyAccessor
olkPA.SetProperty PR_ICON_INDEX, 0
olkMsg.Save
End With
Next

Set olkMsg = Nothing
Set objItems = Nothing
Set objFolder = Nothing
Set objOL = Nothing
End Sub

As i said i am not programmer so it is too hard for me to create macro by myself. I would be grateful for advice. Thx
 

mcwiciu

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
That's it!!!!!

It works!!!!!!!!!

You are GREAT!!!!!!!!!!!!!!!!!!

Thx thx thx!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
Status
Not open for further replies.
Top