Michel,
see this:
#define outlookFolderCalendar 9
#define olFolderContacts 10
FUNCTION PrendiDatiOutlook()
LOCAL oOutlook, hApptItem, oNameSpace, ocalendar, hOutlook, ;
lSave := .F., ;
lFOUND := .F., ;
cTxt,;
I := 0, nItems
TRY
CursorWait()
IF !FILE( oV:arc_dir + "eventi.dat" )
DBCREATE( oV:arc_dir + "eventi.dat", {;
{ "EVN_DATE" , "D", 8, 0 },;
{ "EVN_TIME" , "C", 5, 0 },;
{ "EVN_SUBJ" , "C", 20, 0 },;
{ "EVN_IDOUT", "C", 45, 0 },;
{ "EVN_OP" , "C", 2, 0 },;
{ "EVN_MEMO" , "M", 10, 0}})
ENDIF
IF !FILE( oV:arc_dir + "eventi.ind" )
SELECT 0
USE ( oV:arc_dir + "eventi.dat" ) NEW ALIAS eventi EXCLUSIVE
INDEX ON DTOS( FIELD->EVN_DATE ) + FIELD->EVN_TIME TAG uno TO ( oV:arc_dir + "eventi.ind" )
INDEX ON FIELD->EVN_IDOUT TAG due TO ( oV:arc_dir + "eventi.ind" )
USE
ENDIF
SELECT 0
USE ( oV:arc_dir + "eventi.dat" ) NEW ALIAS eventi SHARED INDEX ( oV:arc_dir + "eventi.ind" )
eventi->( ordSetFocus(2) )
oOutlook := CREATEOBJECT( "Outlook.Application" )
oNameSpace := oOutlook:GetNameSpace("MAPI")
ocalendar := oNameSpace:GetDefaultFolder(outlookFolderCalendar )
FERASE("datiOutlook.txt")
nItems := ocalendar:Items:Count
//msginfo( nItems )
FOR I := 1 TO nItems
//msginfo( VALTYPE( ocalendar:Items[ i ]:START ) )
cTxt := PADR( ocalendar:Items[ i ]:ConversationIndex, 45 ) + " - " + ;
PADR( ocalendar:Items[ i ]:START, 19 ) + " - " +;
PADR( ocalendar:Items[ i ]:END, 19 ) + " - " +;
ocalendar:Items[ i ]:SUBJECT + " - " +;
ocalendar:Items[ i ]:Body
IF !eventi->( dbSeek( PADR( ocalendar:Items[ i ]:ConversationIndex, 45 ) ) )
eventi->( dbAppend() )
REPLACE eventi->evn_idout WITH PADR( ocalendar:Items[ i ]:ConversationIndex, 45 )
REPLACE eventi->evn_date WITH CTOD( PADR( ocalendar:Items[ i ]:START, 10 ) )
REPLACE eventi->evn_time WITH RIGHT( PADR( ocalendar:Items[ i ]:START, 19 ), 8 )
REPLACE eventi->evn_subj WITH ocalendar:Items[ i ]:SUBJECT
REPLACE eventi->evn_memo WITH ocalendar:Items[ i ]:BODY
REPLACE eventi->evn_op WITH cOperatore
ENDIF
//01C868AF1EC46949DA0314C440AA9FE7C122E63FE176 - 06/02/2008 18:59:59 - 06/02/2008 19:30:00 - PROVA PROVA PROVA 06-02-2008 - PROVA DI TESTO...
InfStat( cTxt )
WriteInfoTxt( cTxt, , "datiOutlook.txt", .T. )
/*
IF DTOS(ocalendar:Items[ i ]:START) = DTOS(CTOD(CDATE)) .AND. ocalendar:Items[ i ]:SUBJECT = cObjet ;
.AND. ocalendar:Items[ i ]:Body = cNote .AND. ocalendar:Items[ i ]:Duration = NLeninmin
LFOUND := TRUE
I := 1000000
ENDIF
*/
NEXT
OOutlook := NIL
lSave := .t.
CATCH
lSave := .f.
END
eventi->( dbCloseArea() )
CursorArrow()
RETURN NIL
*
**
*
Regards