Try removing the items reference. IE
loFound = oOlC.Find("[Account]='1234567'")
loFound = oOlC.Find("[Lastname]='Santana'")
I can't replicate your customerid problem. The following code works fine:
oOutlook = CreateObject("Outlook.Application")
oNameSpace = oOutlook.GetNameSpace("MAPI")
oContact = oOutlook.CreateItem( 2 )
oContact.CustomerId = 'A100'
?oContact.CustomerId
oContact.Account = '123456'
oContact.Save()
?oContact.CustomerId
>I am trying to use John K's ROC program (raid outlook contacts) from the downloads section to determine if particular contacts exist in Outlook before i add new ones (adding is no problem - with exception noted below). However, the FIND command doesnt find any contacts (loFound is always NULL) - even though there are several with the ACCOUNT or LASTNAME value thats used in the FIND command.
>
>After this PRG runs, i can browse the table and see that there are records with this same info that i am trying to find.
>
>
>
>oOlApp = CreateObject("Outlook.Application")
>oOlNS = oOlApp.GetNameSpace("MAPI")
>oOlC = oOlNS.GetDefaultFolder(10)
>SELECT vfpcontacts
>FOR i = 1 TO oOlC.Items.Count
> WAIT WIND "Record # "+ALLT(STR(i))+" of "+ALLT(STR(oOlC.Items.Count)) NOWAIT
>
> set step on
>
> loFound = oOlC.Items.Find("[Account]='1234567'")
> loFound = oOlC.Items.Find("[Lastname]='Santana'")
>
> INSERT INTO vfpcontacts (lastname, firstname, fullname, ;
> company, email1addr, email1disp,;
> email2addr, email2disp, email3addr, email3disp, ;
> account, nickname) ;
> VALUES ;
> (oOlC.Items(i).LastName,;
> oOlC.Items(i).FirstName,;
> oOlC.Items(i).FullName,;
> oOlC.Items(i).CompanyName,;
> oOlC.Items(i).Email1Address,;
> oOlC.Items(i).Email1DisplayName,;
> oOlC.Items(i).Email2Address,;
> oOlC.Items(i).Email2DisplayName,;
> oOlc.Items(i).Email3Address,;
> oOlC.Items(i).Email3DisplayName,;
> oOlC.Items(i).Account,;
> oOlC.Items(i).NickName)
>ENDFOR
>
>
>
>Also, any time i try to store info into the Outlook 'CustomerID' field, i get the error "OLE iDispatch exception code 4096 from MS Outlook...".
>
>
> .CustomerID = 'A100'
> .Account = '123456'
> .Save()
>
>
>If i comment out the ".CustomerID..." line, it works.