Solved

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

Posted on 2007-03-21
6
166 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now