Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert text file contents into Outlook e-mail body??
Message
 
À
08/08/2001 18:04:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00541587
Message ID:
00541592
Vues:
17
>How can I drive Outlook 2000 to insert the contents of a text file as the body of an e-mail? I do not want to add it as an attachment???
>
>Below is my Foxpro code that includes it as an attachment, but I want to use it as the body text, so that the recipient does not have to open an attachment.
>
>strProfile = "john_may"
>strPassword = "xxxxx"
>strRecipient = "123546@dfgsdfg.com"
>strSubject = "Test object mail"
>strBody = "this is the message"
>
>theApp = CreateObject("Outlook.Application")
>theNameSpace = theApp.GetNameSpace("MAPI")
>theNameSpace.Logon(strProfile , strPassword)
>theMailItem = theApp.CreateItem(0)
>
>theMailItem.Recipients.Add(strRecipient)
>theMailItem.Subject = strSubject
>theMailItem.Body = strBody
>theAttachments = theMailItem.Attachments
>lcFile = "c:\ww1040c.txt"
>theAttachments.Add(lcFile)
>
>
>theMailItem.Send
>theNameSpace.Logoff

Hey Matt -

Have you considered doing something like this?
theMailItem.Body=strBody+CHR(13)+CHR(10)+FILETOSTR("c:\ww1040c.txt")
Scott
Scott King
The Support Source Corporation
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform