Page 1 of 1

Ole and Outlook

Posted: Wed Dec 21, 2005 2:56 pm
by jacquet philippe
I try to use outlook with Ole and receive error message at runtime
UNDEFINED CREATE ITEM

Here is the code
* ===
procedure mole()
local ol,om,oatt
ol:=createoleobject("Outlook.Application")

om:=ol:CreateItem(0) THE ERROR IS HERE !!!!
om:Recipients:Add("jacquet@tiscali.be")
om:Subject:="Le sujet du test OLE"
om:Body:="Le message test OLE"
oatt:=om:attachments
oatt:add("c:\dmedi\test.doc")
om:send()

RETURN



Thanks for any help .
Philippe

Re: Ole and Outlook

Posted: Wed Dec 21, 2005 7:24 pm
by Enrico Maria Giordano
I just tried to compile and run the following sample using pure xHarbour and got no error message:

Code: Select all

FUNCTION MAIN()

    LOCAL oOutlook := CREATEOBJECT( "Outlook.Application" )

    oItem = oOutlook:CreateItem( 0 )

    RETURN NIL
EMG

fivewin ole outlook

Posted: Thu Dec 22, 2005 8:08 am
by jacquet philippe
Thanks for this answer but i wanted to do it with FW 2.3 or 2.5
and i receive an compile error with the CREATEOBJECT instruction .

Thanks .

Philippe

Posted: Thu Dec 22, 2005 8:11 am
by Antonio Linares
Philippe,

OCXs are 32 bits components.

We do recommend you to port your application to 32 bits using FiveWin for Harbour/xharbour. The 32 bits full integration will solve the problems you may find.

Re: fivewin ole outlook

Posted: Thu Dec 22, 2005 10:11 am
by Enrico Maria Giordano
Try replacing CREATEOBJECT() with TOleAuto():New(). But you will need of OLE2.LIB. And, as Antonio stated, I'm not sure it will work in 16 bit.

EMG