Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP 5.0 Outlook 98 and Windows XP

Status
Not open for further replies.

dswift

Programmer
Dec 11, 2001
7
0
0
GB
The following code works on Windows 95 but gives this error on XP - OLE IDispatch exception code 4096 from Microsoft Outlook

The line that fails is shown in capitals.
Can any of you help?


objOutlook = createobject ('Outlook.Application')
objNamespace = objOutlook.GetNamespace('MAPI')

*Attempt to get Outlook Actions where [mileage] contains client and matter number

*set up the search clause for example "[mileage] = '1-202'"

myclause="[mileage] = '"+alltrim(curcli)+"-"+alltrim(curmat)+"'"

LOITEM=NUMITEMS.FIND(MYCLAUSE)

do while isnull(loitem)=.F.
x=x+1
Myitem=loitem
* Myitem.display

outlst(x,1)=Myitem.billinginformation
outlst(x,2)=Myitem.subject
outlst(x,3)=Myitem.start
outlst(x,4)='None'
outlst(x,5)=Myitem.body
if Myitem.alldayevent=.t. Then
outlst(x,6)='Event'
else
outlst(x,6)='Appointment'
endif

loitem=numitems.findnext
enddo

 
HI
Try
LOITEM=NUMITEMS.FIND(&MYCLAUSE)
ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
As spinoff of this topic ...

I have some OLE Outlook code in VFP6 software which works fine in WIN98 operating system. It fails with that same message (see above) when it runs in XP or WIN2000.

Anyone have a more generalized understanding of what the problem is and the cure ?

Don
dond@csrinc.com

 
I can add a Task or an Appointment OK in Windows 98 and XP using Visual Foxpro 5.0, it just seems to be the Find or Restrict methods that give the error.

I seem to remember reading something about older versions of DAO or something. I wonder if XP is using an older DLL or something like that.
 
Just to let you all know, the problem is fixed. My code was OK, I cured it by installing Outlook 98 using the Full install options rather than the Standard Installation.

This must have installed some additional DLL files.

Dave Swift
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top