How to Use Schedule+ 7.0 OLE Automation in Visual FoxProID: Q147283 3.00 3.00b WINDOWS kbinterop kbhowto The information in this article applies to:
SUMMARYWithin Visual FoxPro, you can take advantage of the OLE Automation capabilities of Schedule+ 7.0 to read or modify your appointments, contacts, task list, and projects.
MORE INFORMATIONSchedule+ 7.0 doesn't export an OLE Automation Type library as you might be used to. What it does expose is the ability to gain access to table objects within the Schedule+ object. You can navigate these table objects by using exposed Schedule+ 7.0 methods. The Appointment table is one table you might want to examine from inside a Visual FoxPro application. You can use the Schedule+ 7.0 Skip method to maneuver through the table in a manner similar to what you might do with a Visual FoxPro table. And you can use the Schedule+ 7.0 GetRows() method, which is quite similar to a SELECT INTO ARRAY. There are also SetRange and SetRestriction methods that give you filtering capability to specify the records you want to search. The following three code samples show some of the basic functions that can be performed:
Code Sample to Create New Schedule AppointmentsThe following code shows how to use the NEW method to add 100 appointments for 1996. It creates a start and end datetime string for each appointment along with some text that denotes it as a test. ******************************** ********************************
PUBLIC appt,x,count,st,end,what,notes,fAppt x=CreateObject('scheduleplus.application.7') IF !x.loggedon() ENDIF
appt=x.Schedulelogged.appointments
count=0
appt.reset
count=1
y=96
FOR m=1 to 12
ENDFOR
******************************** ********************************
Code Sample to Remove Scheduled AppointmentsThe following code shows how to use OLE Automation to automate Schedule+ 7.0 to remove all tentative appointments, which are denoted by a BUSYTYPE!=1. It also shows how to use the SKIP and DELETEITEM methods. ******************************** ********************************
CLEAR ALL PUBLIC appt,x,count,st,end,what,notes,fAppt x=CreateObject('scheduleplus.application.7') IF !x.loggedon() ENDIF
appt=x.Schedulelogged.appointments
appt.reset
DO WHILE !(appt.isendoftable)
ENDDO
CLEAR ALL
******************************** ********************************
Code Sample to Read Scheduled Appointments and Populate a GridThe following code shows how to use the GetRows() method to pass through the OLE layer once for each 100 records. This is a large performance increase over using the Skip method to move to each records and grab its attributes. Specifically, the code shows how to use OLE Automation to automate Schedule+ and populate a grid with the appointments. ******************************** ********************************
PUBLIC x,count,st,end,what,notes,fAppt x=CreateObject('scheduleplus.application.7') IF !x.loggedon() ENDIF
appt=x.Schedulelogged.appointments
appt.reset
count=0
dime myarr(100,3)
oldval=set('safety')
SET SAFETY OFF
CREATE TABLE apptlist (Text c(40), Start T(10),End T(10))
SET SAFETY &oldval
DO WHILE NOT(appt.isendoftable)
ENDDO
fAppt=CreateObject('form')
fAppt.Addobject('Grid1','Grid')
fAppt.width=800
WITH fAppt.Grid1
ENDWITH
GO TOP
fAppt.show
******************************** ********************************
REFERENCESFor more information on this, please consult the Schedule+ help file provided with the Exchange Developers Kit or contact the Exchange/Schedule+ product support team. Additional reference words: 3.00 3.00b VFoxWin splus KBCategory: kbinterop kbhowto KBSubcategory: FxinteropOle
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |