FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Urgent question about Outlook
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Urgent question about Outlook
Posted: Tue Mar 20, 2007 03:43 PM

Hello,

I urgently need some WORKING examples for my FW application to :

  1. Read an appointment out of Outlook
  2. Write an appointment to Outlook
  3. Read a task out of Outlook
  4. Write a task to Outlook
  5. Read messages from the Inbox.

Can someone provide these to me ?

Thank you very much in advance.

Michel

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Urgent question about Outlook
Posted: Tue Mar 20, 2007 06:11 PM
This is a working sample for Inbox:

#define olFolderInbox 6


FUNCTION MAIN()

    LOCAL oOutlook := CREATEOBJECT( "Outlook.Application" )
    LOCAL oNameSpace := oOutlook:GetNameSpace("MAPI")
    LOCAL oInbox := oNameSpace:GetDefaultFolder( olFolderInbox )

    LOCAL i

    FOR i = 1 TO oInbox:Items:Count
        ? oInbox:Items[ i ]:Body
        ?
    NEXT

    oOutlook:Quit()

    RETURN NIL


EMG
Posts: 97
Joined: Sun Nov 20, 2005 04:32 PM
Re: Urgent question about Outlook
Posted: Wed Mar 21, 2007 06:18 PM
Sample for Add-Task

FUNCTION AddOLTask( cDate, cSubject, cNotiz, cTime )

   LOCAL hOutlook, hAppItem, dDate
   LOCAL lSave := .f.
   TRY
      hOutlook := CreateOLEObject( "Outlook.Application"
      hAppItem := OLEInvoke( hOutlook, "CreateItem", 3 )
      dDate := CToD( cDate )
      OLESetProperty( hAppItem, "DueDate", dDate )
      OLESetProperty( hAppItem, "Remindertime", cDate + " " + cTime )
      OLESetProperty( hAppItem, "ReminderSet", "Y" )
      OLESetProperty( hAppItem, "StartDate", Date() )
      SET CENTURY ON
      SET Date TO GERMAN
      OLESetProperty( hAppItem, "Duration", 60 )
      OLESetProperty( hAppItem, "Subject", cSubject )
      OLESetProperty( hAppItem, "Body", cNotiz )
      OLESetProperty( hAppItem, "StartTime", cTime + ":00" )
      OLEInvoke( hAppItem, "Save" )
      hAppItem := NIL
      hOutlook := NIL
      lSave := .t.
   CATCH
      lSave := .f.
   END
RETURN (lSave)
Posts: 97
Joined: Sun Nov 20, 2005 04:32 PM
Re: Urgent question about Outlook
Posted: Wed Mar 21, 2007 06:24 PM
Sample Add appointment

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)
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Urgent question about Outlook
Posted: Thu Mar 22, 2007 01:02 AM

Thanks, guys.

I'll try out your code.

And I hope there is more to come here.

Thank you su much.

Michel

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Continue the discussion