PC Review


Reply
Thread Tools Rate Thread

Appointment item properties

 
 
dxider
Guest
Posts: n/a
 
      7th Jun 2009
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!!!!
 
Reply With Quote
 
 
 
 
Michael Bauer [MVP - Outlook]
Guest
Posts: n/a
 
      8th Jun 2009


http://www.vboffice.net/sample.html?...5&cmd=showitem

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Sat, 6 Jun 2009 22:16:01 -0700 schrieb 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, Ive tried for about 3 days and not answer in

all
> the internet.
>
> Thanks in advance.

 
Reply With Quote
 
dxider
Guest
Posts: n/a
 
      9th Jun 2009
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


"dxider" wrote:

> 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!!!!

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      9th Jun 2009
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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"dxider" <(E-Mail Removed)> wrote in message
news:18673AAC-32E5-402B-861C-(E-Mail Removed)...
> 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
>
>
> "dxider" wrote:
>
>> 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!!!!


 
Reply With Quote
 
dxider
Guest
Posts: n/a
 
      25th Jun 2009

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.
--
Dream it, love it, CODE IT!!!


"dxider" wrote:

> 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
>
>
> "dxider" wrote:
>
> > 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!!!!

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      26th Jun 2009

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"dxider" <(E-Mail Removed)> wrote in message
news:C8731587-66B3-4E4A-978C-(E-Mail Removed)...
>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.
> --
> Dream it, love it, CODE IT!!!
>
>
> "dxider" wrote:
>
>> 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
>>
>>
>> "dxider" wrote:
>>
>> > 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!!!!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: "Cannot update the appointment because the corresponding item in the folder you syncronized does not match this item" Roady [MVP] Microsoft Outlook 0 26th Jun 2008 12:29 AM
Re: HTML Item properties vs. Regular item properties Dmitry Streblechenko Microsoft Outlook VBA Programming 5 22nd Dec 2006 05:43 AM
How to change an item from a recurring Appointment item to an exception from VB code? Dikbill Microsoft Outlook VBA Programming 2 13th Jul 2006 08:45 AM
Saving exception item in recurring appointment item fails Dikbill Microsoft Outlook VBA Programming 2 11th Jul 2006 03:59 PM
Saving exception item in recurring appointment item fails Dikbill Microsoft Outlook Calendar 0 11th Jul 2006 02:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:24 PM.