PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Appointments and Fields

Reply

Appointments and Fields

 
Thread Tools Rate Thread
Old 14-03-2006, 01:37 PM   #1
Ian Mackenzie
Guest
 
Posts: n/a
Default Appointments and Fields


Hi guys

I am trying to create a new appointment, but it seems I am creatinh a new
mailitem each time because I can't assign things like location, startand end
to the appointment. My code is below. Does anyone have an idea about how to
go about it.

I have the same problem with the same fields when I try to fetch
appointments too...

const
olAppointmentItem = $00000001;
var
AppItem : OLEVariant;
begin

AppItem := CurrentFolder.Items.Add(olAppointmentItem);

---------------------------------------------------------
**CurrentFolder = NameSpace.GetDefaultFolder(9)
**Whats the difference between using NameSpace and RDOSession with
Redemption?
**Do you still get the same folder?
---------------------------------------------------------

AppItem .AllDayEvent := AllDayEvent; *ERROR*
AppItem .Body := Body;
AppItem .Categories := Categories;
AppItem .Duration := Duration; *ERROR*
AppItem .Start := Now() + 0.05; *ERROR*
AppItem .End := Now() + 10; *ERROR*
AppItem .Location := Location; *ERROR*
AppItem .ReminderTime := ReminderTime;
AppItem .ReminderSet := ReminderSet;
AppItem .Subject := Subject;

AppItem .Display;

AppItem := Unassigned;
end;


  Reply With Quote
Old 14-03-2006, 03:43 PM   #2
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: Appointments and Fields

Using the Outlook object model you get Outlook items. Using RDOSession you
get an RDOMail object. It represents the same object but with different
properties, methods and events. Many things are exposed in an RDOMail object
that you can't get to in an Outlook item.

You don't really have spaces between the object and its properties in your
code do you?

Have you run in debug mode and verified the .Class of the item you created?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ian Mackenzie" <ianm@synapsissoftware.com> wrote in message
news:eeGtRy2RGHA.4384@tk2msftngp13.phx.gbl...
> Hi guys
>
> I am trying to create a new appointment, but it seems I am creatinh a new
> mailitem each time because I can't assign things like location, startand
> end to the appointment. My code is below. Does anyone have an idea about
> how to go about it.
>
> I have the same problem with the same fields when I try to fetch
> appointments too...
>
> const
> olAppointmentItem = $00000001;
> var
> AppItem : OLEVariant;
> begin
>
> AppItem := CurrentFolder.Items.Add(olAppointmentItem);
>
> ---------------------------------------------------------
> **CurrentFolder = NameSpace.GetDefaultFolder(9)
> **Whats the difference between using NameSpace and RDOSession with
> Redemption?
> **Do you still get the same folder?
> ---------------------------------------------------------
>
> AppItem .AllDayEvent := AllDayEvent; *ERROR*
> AppItem .Body := Body;
> AppItem .Categories := Categories;
> AppItem .Duration := Duration; *ERROR*
> AppItem .Start := Now() + 0.05; *ERROR*
> AppItem .End := Now() + 10; *ERROR*
> AppItem .Location := Location; *ERROR*
> AppItem .ReminderTime := ReminderTime;
> AppItem .ReminderSet := ReminderSet;
> AppItem .Subject := Subject;
>
> AppItem .Display;
>
> AppItem := Unassigned;
> end;
>
>


  Reply With Quote
Old 14-03-2006, 06:37 PM   #3
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: Appointments and Fields

Also note that you can get the appointment specific properties from RDOMail
using RDOMail.Fields. Look at the appointmenbts with OutlookSpy (click
IMessage) to figure out the prop tags.
E.g to access the duration property, try something like

RDOMail.Fields("urn:schemas:calendar:duration") := Duration;

or
const PT_LONG = 3;
....
PR_DURATION =
RDOMail.GetIDsFromNames('{00062002-0000-0000-C000-000000000046}', $8213) or
PT_LONG;
RDOMail.Fields(PR_DURATION):= Duration;

See http://www.dimastr.com/redemption/utils.htm#xmapi and
http://www.dimastr.com/redemption/r....htm#properties

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
news:OFgif43RGHA.6084@TK2MSFTNGP14.phx.gbl...
> Using the Outlook object model you get Outlook items. Using RDOSession you
> get an RDOMail object. It represents the same object but with different
> properties, methods and events. Many things are exposed in an RDOMail
> object that you can't get to in an Outlook item.
>
> You don't really have spaces between the object and its properties in your
> code do you?
>
> Have you run in debug mode and verified the .Class of the item you
> created?
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Ian Mackenzie" <ianm@synapsissoftware.com> wrote in message
> news:eeGtRy2RGHA.4384@tk2msftngp13.phx.gbl...
>> Hi guys
>>
>> I am trying to create a new appointment, but it seems I am creatinh a new
>> mailitem each time because I can't assign things like location, startand
>> end to the appointment. My code is below. Does anyone have an idea about
>> how to go about it.
>>
>> I have the same problem with the same fields when I try to fetch
>> appointments too...
>>
>> const
>> olAppointmentItem = $00000001;
>> var
>> AppItem : OLEVariant;
>> begin
>>
>> AppItem := CurrentFolder.Items.Add(olAppointmentItem);
>>
>> ---------------------------------------------------------
>> **CurrentFolder = NameSpace.GetDefaultFolder(9)
>> **Whats the difference between using NameSpace and RDOSession with
>> Redemption?
>> **Do you still get the same folder?
>> ---------------------------------------------------------
>>
>> AppItem .AllDayEvent := AllDayEvent; *ERROR*
>> AppItem .Body := Body;
>> AppItem .Categories := Categories;
>> AppItem .Duration := Duration; *ERROR*
>> AppItem .Start := Now() + 0.05; *ERROR*
>> AppItem .End := Now() + 10; *ERROR*
>> AppItem .Location := Location; *ERROR*
>> AppItem .ReminderTime := ReminderTime;
>> AppItem .ReminderSet := ReminderSet;
>> AppItem .Subject := Subject;
>>
>> AppItem .Display;
>>
>> AppItem := Unassigned;
>> end;
>>
>>

>



  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

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