Appointment item properties

Status
Not open for further replies.
D

dxider

Hi, im programming an AddIn that gets information abount appointment items

and saves un-sync items to a SQL Server DataBase. All is working ok, but now

I'm trying to get the appointment label text and can't find the exact method

or propertie to get this information. If someone knows hot to get the Label

text, please let me know, I´ve tried for about 3 days and not answer in all

the internet.

Thanks in advance.

Dream it, love it, CODE IT!!!!
 
Thanks a lot for your help, I still can't get the appointment's label text,

I'm thinking in implementing custom properties to solve this issue.

g
 
There is no property that holds an appointment's label text. The property

(not exposed in the Outlook object model) is a 32-bit integer that is part

of an enumeration. All you get is a value from the enumeration that

corresponds to the label color and text. For example, None = 0, Important =

1, Business = 2, etc.

The property is a named property that can be retrieved in Outlook 2007 using

the DASL property tag of

"http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/82140003"

(note that this is a string DASL property tag and not a URL).

You can retrieve this property using an alternate API such as CDO 1.21 or

Redemption (www.dimastr.com/redemption), but not when using the Outlook

object model, except in Outlook 2007, where you can use that DASL property

tag with the PropertyAccessor object for the appointment item.

 
I almost forgot to share with you the final solution of this problem, this

are the 2 functions needed:

using nov=System.Reflection.Missing;

// Get the index of selected label for the appointment

private int getLabel(AppointmentItem actividad)

{

MAPI.Session ses = new MAPI.Session();

ses.Logon(nov.Value, nov.Value, false, false, nov.Value,

nov.Value, nov.Value);

MAPI.Message mens =

(MAPI.Message)ses.GetMessage(actividad.EntryID, nov.Value);

MAPI.Fields campos = (MAPI.Fields)mens.Fields;

MAPI.Field campo = (MAPI.Field)campos.get_Item("0x8214",

"0220060000000000C000000000000046");

int label = int.Parse(campo.Value.ToString());

ses.Logoff();

return label;

}

// Retur the label text according with the index passed

private string setLabel(int numero)

{

string etiqueta = "";

switch (numero)

{

case 1:

etiqueta = "PLANEACIÓN Y SEGUIMIENTO";

break;

case 2:

etiqueta = "ANÁLISIS";

break;

case 3:

etiqueta = "DISEÑO";

break;

case 4:

etiqueta = "DESARROLLO";

break;

case 5:

etiqueta = "REPROCESO";

break;

case 6:

etiqueta = "PRUEBAS";

break;

case 7:

etiqueta = "INVESTIGACIÓN Y CAPACITACIÓN";

break;

case 8:

etiqueta = "DESPLIEGUE Y SOPORTE AL CLIENTE";

break;

case 9:

etiqueta = "INTERRUPCIONES";

break;

case 10:

etiqueta = "Personal";

break;

}

return etiqueta;

}

To get the appointment Label, just install CDO 1.2.1 from Microsoft, add a

reference to the project and use this function call:

string label="";

label=setLabel(getLabel(appointmentObject));

Just change the code inside the switch in the setLabel function, to work

according to your Outlook label definitions.
 
Please be advised that for managed code CDO 1.21 is not supported at all. It

might appear to work correctly, for a while and in various tests, but there

are memory leaks and problems in memory management that make this a

non-supported solution. Not a good idea at all.

If Outlook 2007 is being used one can use the PropertyAccessor object to

replace any CDO code, if not a 3rd party COM wrapper over MAPI such as

Redemption (www.dimastr.com/redemption) is the preferred way.

 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
N Adding Appointment Item in Outlook to Shared Calendar Folder Outlook VBA and Custom Forms 7
B Extract Dates for Appointment Item in Body of email Outlook VBA and Custom Forms 10
S VBA to modify appointment item in additional Exchange account doesn't work Using Outlook 0
M Outlook Appointment Item exceeds beyond the date range Using Outlook 2
M Outlook Appointment item does not show the item outside the date range Using Outlook 2
P Contact Details from Appointment Item Outlook VBA and Custom Forms 1
V VBA Categories unrelated to visible calendar and Visual appointment Categories Outlook VBA and Custom Forms 2
M using excel to sort outlook appointment items Outlook VBA and Custom Forms 4
F Add a category before "Send an Email When You Add an Appointment to Your Calendar" Outlook VBA and Custom Forms 0
B Linking contact to an Appointment Using Outlook 1
S Appointment font size when printing only changes Tasks' font Using Outlook 0
D Copy Appointment Body to Task Body Outlook VBA and Custom Forms 0
S New Outlook Appointment - Select All Body Text and Change Font and Size Outlook VBA and Custom Forms 1
e_a_g_l_e_p_i Outlook 2010 How can I change the font size on right side appointment pane Using Outlook 12
Chiba Create an appointment for all the members Outlook VBA and Custom Forms 1
D Prevent popup of "Do you want to save changes?" when closing after opening an appointment to view Outlook VBA and Custom Forms 2
O Calendar - appointment templates and categories Using Outlook 1
W Appointment userproperties disappear Outlook VBA and Custom Forms 4
Nessa Can't create new appointment Using Outlook 1
F Appointment Show All Fields Using Outlook 1
C Trying to populate an appointment ComboBox from Excel Outlook VBA and Custom Forms 2
A Possible to hide ribbon with custom appointment form? Outlook VBA and Custom Forms 3
W Appointment occurrences change the location property Using Outlook 0
W Space in an Outlook appointment body Using Outlook 0
Dave A Run macro on existing appointment when it changes Outlook VBA and Custom Forms 1
JoeG Appointment Delete/Change Recurrence Outlook VBA and Custom Forms 0
S Display PF contact folder items to select contact to link to appointment Outlook VBA and Custom Forms 1
M Forward Appointment as BCC with VBScript Outlook VBA and Custom Forms 7
K Update Appointment category when changed in Excel Using Outlook 3
S View Appointment in Text Wrap in Outlook 2007 Month Calendar View Using Outlook 0
A Day view - print appointment details Using Outlook 1
R Recover Deleted Appointment in Calendar Using Outlook 0
N Select Appointment subject line from combobox or list Outlook VBA and Custom Forms 1
S Appointment-Cannot set Categories because ConversationID is not set Outlook VBA and Custom Forms 1
D Record Appointment to Calendar on "Public Folder" Outlook VBA and Custom Forms 13
G Copy Contact field to Appointment Custom Form Field Outlook VBA and Custom Forms 2
G How to Copy Multi Select Listbox Data to Appointment Outlook VBA and Custom Forms 3
S Appointment colour categories disappear Using Outlook 4
G Using Data From Combo Box in Appointment Body Outlook VBA and Custom Forms 6
C Set reminder / appointment by right clicking email Using Outlook 1
A Add attachments to appointment based on field values Outlook VBA and Custom Forms 0
S how to set user properties to a newly created appointment Outlook VBA and Custom Forms 12
Y Creating custom appointment request form with multiple mail recipients Outlook VBA and Custom Forms 5
S my vbscript button1_click code works on appointment created but not on opening an existing apntmn Outlook VBA and Custom Forms 16
G Create an Appointment at the Contact's Address From Email Outlook VBA and Custom Forms 0
Diane Poremsky Create Task or Appointment and Insert Selected Text Using Outlook 0
Pierce007 Maps/location in making an appointment Using Outlook 2
A Get shared calendar name or id in custom appointment form Using Outlook 0
Diane Poremsky Create Appointment From Email Automatically Using Outlook 0
C Reminder for single-click appointment Using Outlook 2

Similar threads

Back
Top