?
Solved

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

Posted on 2007-03-21
6
Medium Priority
?
200 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 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
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: …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

718 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