Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MAPI Text Format
Message
De
05/03/2003 17:32:43
 
 
À
05/03/2003 16:59:07
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00761820
Message ID:
00761835
Vues:
21
Renoir,

Assuming outlook as the email object, use HTML instead to build a table... 99% of Outlook users accept HTML/RTF messages.

In brief:
#DEFINE CRLF CHR(13) + CHR(10)

LOCAL lnROw, lnColumn, lnOnColumn, lnOnRow, myText
lnRow = number of table rows to use
lnColumn = 4 && number of field items to use... I will use 4 as an example.  Note that you will need to set your width of 
   each column based on the number of columns/100 initially, then you can adjust specific widths based on text lenghth
lnOnRow = 0 &&current record number
lnOnField = 0 &&current field number
myText = "" HTMLSTring + field data we will send as message

*-- you will see below a reference to the current field as 'YOURTABLEDATA'.  Insure you convert accordingly to string value
*-- ie: source data is number then STR(YOURTABLEDATA), source data is date then DTOC(YOURTABLEDATA), etc....

*-- Note: default HTML table width I use is "80%"... generally good enough for most window sizes... and remember, HTML
*-- will automatically compress column widths based on percentage against the current viewing window size

myText = '<table bordercolor="#000000" border="1" width="80%">' + CRLF
*-- Repeat for each row in the table
FOR lnOnRow = 1 TO lnRow
 myText = myText + '<tr valign="center">'
   *-- Repeat for each column
   FOR lnOnField = 1 TO lnColumn
    myText = myText + '<td width="25%">' + CRLF
    myText = myText + '<font face=Arial>' + YOURTABLEDATA + '</font></td>' + CRLF
   NEXT lnOnField
   myText = myText + '</tr>' + CRLF
NEXT lnOnRow
myText = myText + '</table>'

*-- do the stuff to make a message, like Namespace, etc...

*-- Change the body of the message, instead of:
  *-- myMsg.Body = myText
  *-- use:
  myMsg.HTMLBody = myText

*--- send the message...
HTH,

Ric
>I'm using the Mapi OLE control to send mail automatically. I've built a list with columns that I'm sending in the body of the message. Unless the recipient has their text formatted as fixed then it does not look nice. Can I force a format to display what I'm sending? Thanks!
>
>Regards, Renoir
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform