FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Create appointment in outlook
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Create appointment in outlook
Posted: Fri Nov 16, 2007 12:40 AM

Hello,

Can you someone provide an example of how to create an appointment in outlook.

Thank you,

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Create appointment in outlook
Posted: Fri Nov 16, 2007 01:27 AM
I copied this from another message. I have never tried it and you probably don't need the SET DATE TO GERMAN unless you are Germany.

James


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)
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Create appointment in outlook
Posted: Fri Nov 16, 2007 02:12 AM

Hi James,

Thanks for your help!

Regards,

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Create appointment in outlook
Posted: Fri Nov 16, 2007 08:48 AM

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

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Create appointment in outlook
Posted: Fri Nov 16, 2007 08:54 AM

Enrico,

>James, why do you...

I didn't write it.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Create appointment in outlook
Posted: Fri Nov 16, 2007 10:37 AM

Ops! Sorry. :-)

EMG

Continue the discussion