Retrieve items from contact folders in Outlook

Retrieve items from contact folders in Outlook

Postby MarcoBoschi » Mon Sep 21, 2009 11:52 am

Hi,
I have to rewrite this program in order to retrieve all fields from all contact folders.
Actually this sample program show me only a few fields from default contact folder.
I have to questions:
1) How can I obtain an Array that contains a list of all contact folders?
2) Ho can I ontain an Array containing all field in a contact

In this way I am able to nest tree for next

FOR iFolder := 1 TO oFolder:count
FOR iContact := 1 TO oContact:count
FOR iField := 1 TO oField:count
? FolderName, ContactName, ContactPhone, ContactEmail, etc, etc,
NEXT iField

NEXT iContact
NEXT iFolder



Thanks In advance

marco

#include "fivewin.ch"
#define olFolderContacts 10

FUNCTION MAIN()

LOCAL oOutlook := CREATEOBJECT( "Outlook.Application" )
LOCAL oNameSpace := oOutlook:GetNameSpace("MAPI")
LOCAL oContacts := oNameSpace:GetDefaultFolder( olFolderContacts )

LOCAL i

SET DATE BRITISH

FOR i = 1 TO oContacts:Items:Count
? oContacts:Items[ i ]:FullName , ;
oContacts:Items[ i ]:BusinessAddressStreet , ;
oContacts:Items[ i ]:BusinessAddressPostalCode , ;
oContacts:Items[ i ]:BusinessAddressCity , ;
oContacts:Items[ i ]:BusinessAddressState , ;
oContacts:Items[ i ]:BusinessAddressCountry , ;
oContacts:Items[ i ]:BusinessTelephoneNumber , ;
oContacts:Items[ i ]:Email1Address , ;
oContacts:Items[ i ]:LastModificationTime , ;
oContacts:Items[ i ]:Categories
NEXT

oOutlook:Quit()

RETURN NIL
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Retrieve items from contact folders in Outlook

Postby MarcoBoschi » Tue Sep 22, 2009 2:47 pm

Hi everybody,
the problem has been solved in another way.

Thanks to all
marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Retrieve items from contact folders in Outlook

Postby Randal » Tue Sep 22, 2009 4:41 pm

Marco,

Can you tell us how you solved this problem?

Thanks,
Randal
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Re: Retrieve items from contact folders in Outlook

Postby MarcoBoschi » Wed Sep 23, 2009 7:05 am

Excuse me,
I meant to say: the problem of extracting the data, not write a program to extract them.
I copy every folder into contact folder and use this program
When I have time I will study this problem.

#include "fivewin.ch"
#define olFolderContacts 10

ANNOUNCE RDDSYS

FUNCTION MAIN( cNomeFile )

LOCAL oOutlook := CREATEOBJECT( "Outlook.Application" )
LOCAL oNameSpace := oOutlook:GetNameSpace("MAPI")
LOCAL oContacts := oNameSpace:GetDefaultFolder( olFolderContacts )

LOCAL i
LOCAL aStruct := {}
AADD( aStruct , { "NOME" , "C" , 50 , 0 } )
AADD( aStruct , { "INDI" , "C" , 50 , 0 } )
AADD( aStruct , { "CAP" , "C" , 5 , 0 } )
AADD( aStruct , { "CITTA" , "C" , 50 , 0 } )
AADD( aStruct , { "STATO" , "C" , 50 , 0 } )
AADD( aStruct , { "STATO2" , "C" , 50 , 0 } )
AADD( aStruct , { "TELEFONO" , "C" , 50 , 0 } )
AADD( aStruct , { "EMAIL" , "C" , 50 , 0 } )
AADD( aStruct , { "NOTE" , "M" , 10 , 0 } )

DbCreate( cNomeFile , aStruct, "DBFCDX" )


SET DATE BRITISH
USE &cNomeFIle

FOR i = 1 TO oContacts:Items:Count
APPEND BLANK
REPLACE field->nome WITH oContacts:Items[ i ]:FullName
REPLACE field->indi WITH oContacts:Items[ i ]:BusinessAddressStreet
REPLACE field->cap WITH oContacts:Items[ i ]:BusinessAddressPostalCode
REPLACE field->citta WITH oContacts:Items[ i ]:BusinessAddressCity
REPLACE field->stato WITH oContacts:Items[ i ]:BusinessAddressState
REPLACE field->stato2 WITH oContacts:Items[ i ]:BusinessAddressCountry
REPLACE field->telefono WITH oContacts:Items[ i ]:BusinessTelephoneNumber
REPLACE field->email WITH oContacts:Items[ i ]:Email1Address
REPLACE field->note WITH oContacts:Items[ i ]:Body

NEXT

oOutlook:Quit()

RETURN NIL


INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" )
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Retrieve items from contact folders in Outlook

Postby Otto » Wed Sep 23, 2009 7:16 am

Hello Marco,
I would be more interested in how you solved this problem:
Code: Select all  Expand view
When I have time


Best regards,
Otto :)
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: Retrieve items from contact folders in Outlook

Postby MarcoBoschi » Wed Sep 23, 2009 7:59 am

Otto,
8)
when I have time I will go in Austria to swim, to fish, to walk, to sky...to live!
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests