OLE Object Error ( Argument error )

Moderator: Rathinagiri

Post Reply
User avatar
marco_malac
Posts: 11
Joined: Mon Dec 08, 2008 12:54 pm
Location: Brazil , São Paulo-SP

OLE Object Error ( Argument error )

Post by marco_malac »

Hi people,

I'm using a simple function of OLE instructions for msoutlook (2007), but one of this instructions ( the same of sample ) has something wrong, this message was showed after the line be processed. the compilation is OK.
If somebody have any tip i'll apreciate very much

this is the error message :

Error WINOLE/1007 Argument error:DISPLAY (DOS Error1)

This is my function :

STATIC PROCEDURE OUTLOOKSuporte()

LOCAL oOL, oList, oMail, i, LM

oOL := CreateObject( "Outlook.Application" , "localhost" )
oList := oOL:CreateItem( 0 )

SELE PAR
LM := PAR->WORKF1
oList:to := PAR->WORKF1

SELE SUP
oList:Subject := "Registro de Suporte - GCLIQ"
oList:body := 'Prezado(s),'+ chr(13)+chr(13) + ;
oList:Display(.F.) <=== Error Line
oList:Send()

RETURN
========================================================
"Better than to know about the information is to know what to do with the information that you have."
Marco Antonio ( marco_malac )
Car Tuning / Bikes and adventure around the earth.
RalphMDS
Posts: 21
Joined: Wed Mar 25, 2009 1:24 pm
Location: New Jersey, U.S.A.

Re: OLE Object Error ( Argument error )

Post by RalphMDS »

Hi Marco,

I was running into the same problem as you and couldn't find a solution so I ended up working around the problem like this:

1) In the body of my form I added an Activex control as follows:

DEFINE ACTIVEX Activex_1
ROW 365
COL 39
WIDTH 0
HEIGHT 0
PROGID "shell.explorer.2"
END ACTIVEX

Note that the row and the column don't matter and that the height and width are set to 0 as we don't want the user to see what is going on here.

2) Next I use a function like the following to invoke Outlook:

FUNCTION SendEmail(cemail)

LOCAL oIE

oIE := main.Activex_1.Object
oIE:Navigate( 'mailto:'+trim(cemail) )

RETURN Nil

So far, this has been working well for my application.

Best regards,

Ralph
When your toolbox only contains a hammer, everything looks like a nail...
Post Reply