Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook automation problem
Message
De
22/06/2007 09:42:38
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Outlook automation problem
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01234996
Message ID:
01234996
Vues:
64
I am trying to send contact info to Outlook
the following program imports about 200 or so out ot 4000+ and ten hangs with
the 'Swich to application' ole error dialog box...
What am I doing wrong?

NB: My outlook 2007 also craps out just about every time I use it.
I uninstalled office 2007 and reinstlled it under Vista Ultimate

ALso is there a way to check if a certain fullname already exists in outlook prior to adding it?
LOCAL oAddr AS Outlook.MAPIFolder
LOCAL oContact AS OBJECT

SELECT * FROM DATA\contacts WHERE SOURCE="WH" AND NOT inOutlook ;
	INTO CURSOR cc1 ORDER BY FULLNAME



oOutlook=CREATEOBJECT("OUTLOOK.APPLICATION")
oNameSpace=oOutlook.GetNameSpace('MAPI')

llOut2VFP= .F.
llVFP2Out= .T.




SET STEP ON

IF llVFP2Out
	SELECT cc1
	CNT=0
	SCAN && cc1 (cursor)
			CNT = CNT + 1
			oContact=oOutlook.CreateItem(2)
			WITH oContact
				WAIT WINDOW TIMEOUT 1  TRANSFORM(cnt)+": "+cc1.FULLNAME
				.FULLNAME 				= cc1.FULLNAME
				.LastName 				= cc1.lname
				.FirstName 				= cc1.fname-(" "+cc1.mname)
				.Birthday 				= cc1.bday
				.HomeAddress 			= cc1.hfullAddress
				.HomeAddressCity 		= cc1.hCity
				.HomeAddressState 		= cc1.hState
				.HomeAddressPostalCode	= cc1.hZip
				.HomeTelephoneNumber 	= cc1.hPhone
				.HomeFaxNumber 			= cc1.hFax
				.CarTelephoneNumber 	= cc1.hCell
				.Email1Address			= cc1.email
				.SAVE()
				UPDATE contacts set inOutlook = .T. WHERE contact_id=cc1.contact_id

			ENDWITH
			oContact=NULL

	ENDSCAN

ENDIF
?"Done"
thanks


peter
Peter Cortiel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform