Solved

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

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

9 Experts available now in Live!

Get 1:1 Help Now