BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

file to email body

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX)
View previous topic :: View next topic  
Author Message
ben
Guest





PostPosted: Fri Oct 22, 2004 7:52 pm    Post subject: file to email body Reply with quote



I am using the following code to attach a document to an email. I'm using
bcb6.0. Is there any way to put the formatted text directly into the email
body? The text file that I want to put in there is rtf, but I could
probably switch to html. Any help is greatly appreciated. Thanks,

Ben

AnsiString TempS;
Variant MSOutlook;
Variant TheNameSpace;
Variant MailMessage;
Variant Attachments;
Variant Source;
Source = Temp;
Variant Type;
Type = olByValue;
Variant Position;
Position = 4000;
Variant DisplayName;
DisplayName = "Work attachment";
MSOutlook = CreateOleObject("Outlook.Application") ;
TheNameSpace = MSOutlook.OleFunction("GetNamespace"
,WideString("MAPI"));
TheNameSpace.OleProcedure(WideString("Logon"),WideString("")
,WideString(""),WideString("TRUE"),WideString("True"));
MailMessage = MSOutlook.OleFunction("CreateItem" , (Variant)olMailItem);
TempS = "Case: " + MakeDCSProjectString(&DACurCase);
MailMessage.OlePropertySet("Subject" , WideString(TempS));
TempS = "A summary for case: " + MakeDCSProjectString(&DACurCase) + " "
+ Short(DACurCase.ProjForCaseID.Description) + " is contained in the PDF
attachment.nn";
MailMessage.OlePropertySet("Body" , WideString(TempS));
MailMessage.OleFunction("Save");
Attachments = MailMessage.OlePropertyGet("Attachments");
MailMessage.OleFunction("Save");
Attachments.OleFunction("Add",Source,Type,Position,DisplayName);
MailMessage.OleFunction("Display");


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.