![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
What is the *exact* error message?
Firstly, if you want the default value of a parameter, pass Missing.Value rather null or empty string. Secondly, every time you use multiple dot notation (e.g. rdoFolder2.FolderFields.Add), you get back a brand new COM object back every time, so when you call rdoFolder2.FolderFields.Save, you won't get any new fields. Cache the value of the FolderFields object: RDOFolder2 rdoFolder2 = (RDOFolder2)rdoFolder; RDOFolderFields fields = rdoFolder2.FolderFields; RDOFolderField field =fields.Add("UDF2", rdoUserPropertyType.olText, Missing.Value, Missing.Value); fields.Save; Also try the following VB script (you can run it from "Script Editor" in OutlookSpy): set Session = CreateObject("Redemption.RDOSession") Session.MAPIOBJECT = Application.Session.MAPIOBJECT set Folder = Session.GetFolderFromID(Application.ActiveExplorer .CurrentFolder.EntryID) set FolderFields = Folder.FolderFields set Field = FolderFields.Add("Redemption Text Prop") 'set Field = FolderFields.Add("Redemption Percent Prop", &HD, ,2) 'olPercent, 2 decimals set Field = FolderFields.Add("Redemption Number Prop", &HC, ,3) 'olNumber, 2 decimals FolderFields.Save Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "MA" wrote in message ... Thanks. I have tried the following code without any success. The RDOFolderField - "field" object return null. I have tried without GUID by passing null value. String.empty on Guid return exception. Any suggestions? ------------------------------------ RDOFolder2 rdoFolder2 = (RDOFolder2)rdoFolder; RDOFolderField field = rdoFolder2.FolderFields.Add("UDF2", Redemption.rdoUserPropertyType.olText, "{00020329-0000-0000- C000-000000000046}", 0); if (field != null) rdoFolder2.FolderFields.Save(); --------------------------------- Regards, MA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
More on UserProperties | Steve | Add-ins for Outlook | 13 | November 20th 07 11:12 PM |
UserProperties Icon | Anyone for Coffee? | Add-ins for Outlook | 2 | May 1st 07 09:17 PM |
MailItem UserProperties in OWA (Outlook Web Access) | [email protected] | Outlook and VBA | 5 | April 23rd 07 11:18 AM |
UserProperties | j | Add-ins for Outlook | 0 | February 12th 07 07:06 AM |
VB.net Cannot add userproperties | Ben | Add-ins for Outlook | 2 | February 24th 06 10:32 AM |