A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Access MaiItem.UserProperties using Redemption



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 12th 07, 07:00 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Access MaiItem.UserProperties using Redemption

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 03:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.