Solved

How to create a field in calendar folder for all users.

Posted on 2007-03-21
6
174 Views
Last Modified: 2010-05-18
I have create a custom add-in on my machine that uses a field I have create in the Calendar folder.  Is there a way to create this field in everyone's folder without doing it manually.  I prefer to not have to touch 200 machines.
Thanks
0
Comment
Question by:rkanter
  • 2
  • 2
6 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 18770188
Modify the add-in to check for the existence of the field.  If it doesn't exist, add it.  Something like this:

    Set olkUserProperty = Item.UserProperties.Find("YourPropName")
    If TypeName(olkUserProperty) = "Nothing" Then
        Set olkUserProperty = Item.UserProperties.Add("YourPropName", olText)
    End If
0
 

Author Comment

by:rkanter
ID: 18771551
It didn't work.  I am probably doing something wrong.  Basically, I am trying to add a field to the calendar folder called 'ControlNumber" if it does not already exist.
0
 

Author Comment

by:rkanter
ID: 18771598
One other comemnt. When I debug the code, as soon as it tries to execute the .find it exist the function without any error.  Just to make sure, I add the On error Goto 0 right before it, without any luch
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 18790134
Folder's don't have user-defined fields.  Only the items in a folder have them.  New items in a folder will have whatever fields exist in the default form set for that folder.  The lone exception is if the new item is created based on a different form.  If the form an item is based on does not have the new field, then you can add that field to each item in the folder via code like that I posted above.  Are you sure you're talking about adding an item to a folder?  Might you be talking about adding the item to a view?  As to the code exiting without an error, I can't imagine how that's possible.  I'm not doubting that's what happened, but I can't think of how it could happen.  If the object loaded into Item doesn't have a UserProperties collection, then there should be an error.  Something like the object not supporting that property.  If Item does have a UserProperties collection, then then next line of code should execute.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Find out what you should include to make the best professional email signature for your organization.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question