hello mike,
this is my code
*-------------------------------------
PROCEDURE print_offer
PARAMETER utprtype,utoffnr,utemail,uttaal
*-------------------------------------
*
*
SELECT * FROM f_offglo, f_offdet, f_adres;
WHERE f_offglo.nummer = utoffnr;
AND f_offdet.nummer = f_offglo.nummer;
AND f_adres.TYPE = f_offglo.TYPE;
AND f_adres.nr = f_offglo.nr;
INTO CURSOR tmpcroff READWRITE;
ORDER BY f_offdet.nummer,f_offdet.volgnr
GO TOP
SELECT tmpcroff
GO TOP
*
SET SAFETY off
COPY TO c:\foxprow\ofprint.DBF TYPE FOXPLUS
SET SAFETY ON
IF utprtype=2
DO FORM frmprev.scx WITH "offerte.rpt"
ENDIF
IF utprtype=1
oCRApp = CREATEOBJECT("crystalruntime.application")
oRep = oCRApp.OpenReport("p:\merlijn\offerte.rpt")
oRep.printersetup(0)
oRep.printout(.T.,1,.T.)
ENDIF
IF utprtype=3
m.xxmail=ALLTRIM(utemail)
m.xxattach="p:\merlijn\offertes\"+ALLTRIM(STR(utoffnr,10,0))+".PDF"
m.xxattach1="p:\Standaarddocumenten\Werkdocumenten\NAMGRASSvoorwaarden.pdf"
xxattach=m.xxattach
IF FILE (m.xxattach)
DELETE FILE &xxattach
ENDIF
oCRApp = CREATEOBJECT("crystalruntime.application")
oRep = oCRApp.OpenReport("p:\merlijn\offerte.rpt")
oExport = oRep.Exportoptions()
oExport.Destinationtype = 1
oExport.FormatType = 31
oExport.Diskfilename = "&xxattach"
oRep.EXPORT(.F.)
IF uttaal = "F"
m.xxsubject ="OFFRE NAMGRASS"
* m.xxbody = alltrim(tmpcroff.mailtekst)
m.xxbody ="Chèr Monsieur, Madame,"+CHR(13)+CHR(10)+CHR(13)+CHR(10)+ "Suite à votre demande de prix, nous avons le plaisir de vous envoyer en annexe votre offre de prix."+CHR(13)+CHR(10)+;
+CHR(13)+CHR(10) +"Toujours à votre disposition pour de plus amples informations."+CHR(13)+CHR(10)+;
+CHR(13)+CHR(10) +"Veuillez agréer, madame, monsieurs, nos salutations distinguées."+CHR(13)+CHR(10)+"Service des ventes"
else
m.xxsubject ="OFFERTE NAMGRASS"
* m.xxbody = alltrim(tmpcroff.mailtekst)
m.xxbody ="Geachte,"+CHR(13)+CHR(10)+CHR(13)+CHR(10)+ "Naar aanleiding van uw prijsvraag hebben wij het genoegen u in bijlage uw offerte te laten geworden."+CHR(13)+CHR(10)+;
+CHR(13)+CHR(10) +"Steeds tot uw dienst voor bijkomende inlichtingen."+CHR(13)+CHR(10)+;
+CHR(13)+CHR(10) +"Met vriendelijke groeten,"+CHR(13)+CHR(10)+"Het Verkoopsteam"
ENDIF
o=CREATEOBJECT("outlook.application")
TRY
oitem = o.createitem(0)
CATCH TO loException WHEN INLIST(loException.ERRORNO,1427,1429)
* Messagebox(loException.Details)
* or
MESSAGEBOX("You didn't allow this program to use outlook or outlook isn't open, please try again",0,"this program")
ENDTRY
o=CREATEOBJECT("outlook.application")
oitem = o.createitem(0)
oitem.subject = m.xxsubject
oitem.TO = utemail
oitem.cc = ''
oitem.bcc = ''
oitem.body = m.xxbody
oitem.display()
oitem.Attachments.ADD("&xxattach")
oitem.Attachments.ADD("&xxattach1")
*
oitem.DISPLAY
o=.NULL.
ENDIF
I would like to that m.xxbody = alltrim(tmpcroff.mailtekst)
tmpcroff.mailtekst is a memo field
wfg,
Filip