OLE IDispatch exception code 4096 from Microsoft Office Outllok

L

Leonardo

Hi to everybody,

When I launch my Visual Fox Pro application into my pc everything work
correctly but in another pc I obtain this error message:
OLE IDispatch exception code 4096 from Microsoft Office Outllok...

So, I don't understand where is a problem. That's my code:
#DEFINE olFolderContacts 10
#DEFINE olCurrency 14
#DEFINE olPercent 12

LOCAL loOutlook, loNameSpace, loFolder, loContact, loNewContact

CLOSE DATA ALL

loOutlook = CREATE("Outlook.Application")
loNamespace = loOutlook.GetNameSpace("MAPI")
loFolder = loNameSpace.GetDefaultFolder(olFolderContacts)
valore = ""
nomeFile =SYS(5)+SYS(2003)+"\contatti.txt"
DELETE FILE nomeFile
IF FILE(nomeFile) && Esiste?
contattiFile = FOPEN(nomeFile,12) && Apro in R/W
ELSE
contattiFile = FCREATE(nomeFile) && Altrimenti lo creo
ENDIF

id = SUBSTR(loNameSpace.AddressLists.Item(2).ID,89)
loFolder = loNameSpace.GetFolderFromID(id)

FOR EACH oContact IN loFolder.Items
WITH oContact
valore = .firstname + "---" + .lastname + "---" + .email1address + "---" +
..Categories + "---" + .JobTitle + "---" + .IMAddress + "---" + .CompanyName
+CHR(13)+CHR(10) &&+ "---" +CHR(13)+CHR(10)+ .body + CHR(13)+CHR(10)+ "---"+
CHR(13)+CHR(10)
=FWRITE(contattiFile, valore)
ENDWITH
ENDFOR

FFLUSH(contattiFile)
FCLOSE(contattiFile)

Into the other pc I have correctly installed a setup standard that I use for
all my application and the first use worked correctly but at the moment I
obtain this message.
Can anyone help me ?


Leonardo
 
Top