PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins Item Properties

Reply

Item Properties

 
Thread Tools Rate Thread
Old 25-06-2004, 09:25 PM   #1
msnew.microsoft.com
Guest
 
Posts: n/a
Default Item Properties


Hello,
i am tyring to show some item properties in the folder view but i m unable
to do so. i am enumerating items in the folder change event and i add a
property name "Attachment Count" to each of the item and setting its value
properly. in outlook 2003 when i go into custom sort menu the property
"Attachment Count" is visible to me in the user defined fields and when i
ask Outlook 2003 to sort the items according to these properties nothing
happens.

infact in the messages view of outlook 2003 i enabled the following columns
to be shown.
Subject, to, From, Date and Attachment Count. i can see the column there but
values of each item is just empty though i set the property value as well.
any clue
here is my code of folder change

Dim objFolder As Outlook.MAPIFolder
Set objFolder = m_olApp.ActiveExplorer.CurrentFolder
Dim item As MailItem
Dim nCount As Integer

For Each item In objFolder.Items
Dim property As ItemProperty
Set property = item.ItemProperties.Add("ItemCount", olNumber, True)
property.Value = item.Attachments.Count
MsgBox property.Value
Next

Msgbox shows the right value but in outlook 2003 the column is empty.
Thanks,

i am doing this in Explorer.FolderSwitch . i think i better do it before the
items are rendered . ? any ideas. i also noticed that if i do it in before
folder change event. the very first item has a vlaue of this field otehr
items doesn't



  Reply With Quote
Old 28-06-2004, 06:08 PM   #2
Dmitry Streblechenko \(MVP\)
Guest
 
Posts: n/a
Default Re: Item Properties

Don't forget to call Item.Save.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"msnew.microsoft.com" <danish.qamar@gmail.com> wrote in message
news:eHklUKvWEHA.3540@TK2MSFTNGP10.phx.gbl...
> Hello,
> i am tyring to show some item properties in the folder view but i m unable
> to do so. i am enumerating items in the folder change event and i add a
> property name "Attachment Count" to each of the item and setting its value
> properly. in outlook 2003 when i go into custom sort menu the property
> "Attachment Count" is visible to me in the user defined fields and when i
> ask Outlook 2003 to sort the items according to these properties nothing
> happens.
>
> infact in the messages view of outlook 2003 i enabled the following

columns
> to be shown.
> Subject, to, From, Date and Attachment Count. i can see the column there

but
> values of each item is just empty though i set the property value as well.
> any clue
> here is my code of folder change
>
> Dim objFolder As Outlook.MAPIFolder
> Set objFolder = m_olApp.ActiveExplorer.CurrentFolder
> Dim item As MailItem
> Dim nCount As Integer
>
> For Each item In objFolder.Items
> Dim property As ItemProperty
> Set property = item.ItemProperties.Add("ItemCount", olNumber, True)
> property.Value = item.Attachments.Count
> MsgBox property.Value
> Next
>
> Msgbox shows the right value but in outlook 2003 the column is empty.
> Thanks,
>
> i am doing this in Explorer.FolderSwitch . i think i better do it before

the
> items are rendered . ? any ideas. i also noticed that if i do it in before
> folder change event. the very first item has a vlaue of this field otehr
> items doesn't
>
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off