I have the following code to create emails:
- Code: Select all Expand view RUN
#define olMailItem 0 // A MailItem object.
METHOD Activate() CLASS TMail
local nCtr, cDest := ""
local olApp := CreateObject( "Outlook.Application" )
local olns, oMailItem
oMailItem := olApp:CreateItem(olMailItem)
oMailitem:Subject := ::cSubject
oMailitem:Body := ::cNoteText
for nCtr = 1 to len(::aRecipients)
cDest += ::aRecipients[nCtr]+"; "
next
oMailitem:to := cDest
cDest := ""
for nCtr = 1 to len(::aCC)
cDest += ::aCC[nCtr]+"; "
next
oMailitem:CC := cDest
for nCtr = 1 to len(::aFiles)
try
oMailItem:Attachments:Add(::aFiles[nCtr])
catch
msginfo("Impossibile allegare il file "+trim(::aFiles[nCtr]))
end
next
oMailItem:Display(.t.) // got error here!!!
return (Self)
I was using the above code for many years and with FW0709/xHarbour 1.1 it works without problems.
Now with FW20.02/Harbour 3.2 I get the following error:
Descrizione dell'errore: (DOS Error 1) WINOLE/1007 Parametro errato: DISPLAY
Stack Calls
===========
Called from TOLEAUTO:DISPLAY(0) ->
Called from TMAIL:ACTIVATE(151) -> .\wTMail.prg
Called from CLSSTADOC:GOMAIL(731) -> ..\prg\clsStado.prg
can somebody help to solve?
tank you
Roberto