Hello,
Can you someone provide an example of how to create an appointment in outlook.
Thank you,
Hello,
Can you someone provide an example of how to create an appointment in outlook.
Thank you,
FUNCTION AddOLappointment( cDate, cTime, nLenInMin, cSubject, cNotiz )
LOCAL hOutlook
LOCAL hApptItem
LOCAL dDate
LOCAL lSave := .F.
TRY
hOutlook := CreateOLEObject( "Outlook.Application" )
hAppItem := OLEInvoke( hOutlook, "CreateItem", 1 )
SET CENTURY ON
dDate := CToD( cDate )
OLESetProperty( hAppItem, "Start", cDate + " " + cTime )
OLESetProperty( hAppItem, "StartTime", cTime + ":00" )
SET CENTURY ON
SET Date TO GERMAN
OLESetProperty( hAppItem, "Duration", nLenInMin * 60 )
OLESetProperty( hAppItem, "Subject", cSubject )
OLESetProperty( hAppItem, "Body", cNotiz )
OLESetProperty( hAppItem, "Mileage", 225 )
OLEInvoke( hAppItem, "Save" )
hAppItem := NIL
hOutlook := NIL
lSave := .t.
CATCH
lSave := .f.
END
RETURN (lSave)Hi James,
Thanks for your help!
Regards,
James, why do you use OLEInvoke() and OLESetProperty() instead of the common object oriented syntax? As an example:
hAppItem := hOutlook:CreateItem( 1 )
And, by the way, I would name hOutlook and hAppItem as oOutlook and oAppItem.
EMG
Enrico,
>James, why do you...
I didn't write it.
James
Ops! Sorry. ![]()
EMG