How to add User-defined fields in folder?

  • Thread starter Vladimir Chtchetkine
  • Start date
V

Vladimir Chtchetkine

Hi everyone!
How (within an Add-in, in runtime) can I add "User-
defined fields" in folder? My understanding was (and
still is) that when I add a UserProperty to an item's
UserProperties in folder and set AddToFolderFields param
to "true" this (i.e. adding that property to user-defined
fields) should be done automatically. But somehow this is
not happening. Property gets added to the item's
UserProperties but is not added to the folder's fields
list. Where should I look at in order to fix that?

TIA,

Vladimir
 
V

Vladimir Chtchetkine

.... it seems that I get this problem only when I add
properties on an item that is stored within "private
folders" branch... Unfortunatlly, that's the place I want
to do that job (for a variety of reasons "public folders"
are not acceptable).
So, any ideas how can I fix the problem?

TIA,

Vladimir
 
V

Vladimir Chtchetkine

OK, I figured it out and found a work around :) However,
I have no explanation to what I found :-(
*
Basically, here is my algorithm:
1. Create a folder in Outlook.
2. Create an item in this folder and
a) Add some UserProperties to that item (with
AddToFolder flag set to true)
b) Create new view and add some cusom columns
So, the problem was with the step 2.a and was caused by
the type of the item. What I initially did was creating
(using Application's CreateItem method) and item of type
olMailItem. Then I moved (using item's Move method) that
item into my folder and started adding properties to it.
And those properties have never appeared in my
folder's "user-defined properties for this folder" list.
Instead (as it turned out) they appeared in Inbox's user-
def properties list although item was located in my
folder. And every subsequent attempt to add new user
property to that item was reflected in Inbox's list. And
that's what I can't explain at all :-(
So, the work around that I found was creating olPostItem
instead of olMailItem and use _Items.Add method instead
of CreateItem (I've never tried CreateItem(olPostItem)
though). So, if anyone has comments on that please speak
up :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top