Google Groupes n'accepte plus les nouveaux posts ni abonnements Usenet. Les contenus de l'historique resteront visibles.

Outlook Automation (Calendar)

3 vues
Accéder directement au premier message non lu

Andy Trezise

non lue,
26 nov. 2003, 13:18:0026/11/2003
à
Hi

I am trying to include Outlook in my application...or more to the point just
the calendar / tasks part.

Do anyone have any experience of creating new appointments / tasks in
outlook. I have been able to create a new instance of outlook and summon the
NEWAPPOINTMENT method but I would like to completely automate the process
from my application and add new entries without the outlook interface.

Thanks


Trevor Hancock [MSFT]

non lue,
4 déc. 2003, 16:14:0204/12/2003
à
How about this?

Respectfully,
Trevor Hancock, MCSD
Microsoft Developer Support - FoxPro

This posting is provided "AS IS" with no warranties, and confers no rights.

*-----------------------------------
* AUTHOR: Trevor Hancock (Tre...@Microsoft.com)
* CREATED: 04/15/03 12:17:51 PM
* ABSTRACT: Creates an appointment with selected receptients
* via Outlook automation.
*-----------------------------------

*-- Define some Outlook constants. I found the values for these
*-- by using the Object Browser in Outlook: In Outlook, press F11
*-- to open the VB editor, then press F2 to open the Object Browser.
*-- Change library to Outlook and search away.
#DEFINE olAppointmentItem 1
#DEFINE olMeeting 1

#DEFINE olFree 0
#DEFINE olTentative 1
#DEFINE olBusy 2
#DEFINE olOutOfOffice 3

#DEFINE olRequired 1
#DEFINE olOptional 2

LOCAL loOutlook AS Outlook.APPLICATION, ;
loNS AS Outlook.Namespace, ;
loAppt AS Outlook.AppointmentItem, ;
loRecipts AS Outlook.Recipients, ;
loRecipt AS Outlook.Recipient

*-- Create Outlook and login
loOutlook=CREATEOBJECT([Outlook.Application])
loNS = loOutlook.GetNamespace([MAPI])
loNS.Logon()

*-- Create a new appointment and set it up
loAppt = loOutlook.CreateItem(olAppointmentItem)
WITH loAppt
*-- You need to set MettingStatus to be able to send the appointment.
*-- If you don't, you won't have the option.
*.MeetingStatus = olMeeting
*--
.Subject = [Test Appt]
.Body = [This is the body]
.Location = [Meeting Room 1]
.START = {^2003-12-05,04:00:00 P}
.END = {^2003-12-05,05:00:00 P}
.ReminderSet = .T.
.ReminderMinutesBeforeStart = 15
.BusyStatus = olBusy
.IsOnlineMeeting = .F.

loRecipts = .Recipients
loRecipt = loRecipts.ADD([Trevor Hancock])
loRecipt.TYPE = olRequired && olOptional is other option
loRecipts.ResolveAll()

*-- Save the appointment
.SAVE()
ENDWITH

*-- Clean up after ourselves.
loNS.Logoff()
loRecipts = NULL
loRecipt = NULL
loNS = NULL
loApt = NULL
*loOutlook.QUIT
loOutlook = NULL

Andy Trezise

non lue,
8 déc. 2003, 07:00:2708/12/2003
à
Thank you very much...that works a treat.

Is there anywhere I can find a full set of Methods / Properties for the
Outlook environment (particularly the calendar part)?

Things I would like to do include:

Change the default viewing properties of the calendar...day view / week /
month.
Add items to the task list.
Find all appointments between two times.
Change / store the window properties (ie the size of each section - task
list - calendar - diary).


"Trevor Hancock [MSFT]" <tre...@online.microsoft.com> wrote in message
news:X68AEuqu...@cpmsftngxa07.phx.gbl...

0 nouveau message