Ole and Outlook

Post Reply
jacquet philippe
Posts: 22
Joined: Fri Nov 04, 2005 9:05 pm
Location: LIEGE Belgium

Ole and Outlook

Post 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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Ole and Outlook

Post 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
jacquet philippe
Posts: 22
Joined: Fri Nov 04, 2005 9:05 pm
Location: LIEGE Belgium

fivewin ole outlook

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: fivewin ole outlook

Post 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
Post Reply