Create appointment in outlook

Create appointment in outlook

Postby cdmmaui » 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
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby James Bott » Fri Nov 16, 2007 1: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


Code: Select all  Expand view
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)
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby cdmmaui » Fri Nov 16, 2007 2:12 am

Hi James,

Thanks for your help!

Regards,
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby Enrico Maria Giordano » Fri Nov 16, 2007 8: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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Fri Nov 16, 2007 8:54 am

Enrico,

>James, why do you...

I didn't write it.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Fri Nov 16, 2007 10:37 am

Ops! Sorry. :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 64 guests