Solved

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

Posted on 2007-03-21
6
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
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…

751 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