function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Venki123Venki123 

Creating PPT from salesforce...Need a help to add image and tables

Hi Folks,

 

I was able to generate the PPT from salesfoce ...still i am having problem to add the images and tables in the PPT. Is there any way which i can achieve using this method..Please help me..

 

Messaging.EmailFileAttachment csvAttc = new Messaging.EmailFileAttachment();
List<Account > acclist = [Select id,name from Account limit 10];
string header = 'Record Id, Name \n';
string finalstr = header ;
for(Account a: acclist)
{
string recordString = a.id+','+a.Name+'\n';
finalstr = finalstr +recordString;
}
blob csvBlob = Blob.valueOf(finalstr);
string csvname= 'Venki.ppt';
csvAttc.setFileName(csvname);
csvAttc.setBody(csvBlob);
Messaging.SingleEmailMessage email =new Messaging.SingleEmailMessage();
String[] toAddresses = new list<string> {'test@gmail.com'};
String subject ='Account PPT';
email.setSubject(subject);
email.setToAddresses( toAddresses );
email.setPlainTextBody('Account PPT ');
email.setFileAttachments(new Messaging.EmailFileAttachment[]{csvAttc});
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});

 

Thanks,

Venki

MartinHaagenMartinHaagen
Hi Venki,

if you are to send images within you email message I would expect you to use either a Templete (by setTemplateId) or creating a HTML body for the message (by setHtmlBody).
Venki123Venki123

Hi Martin,

 

  Thank you....

 

  How can i add the image in the generated PPT which comes as an attachment. 

 

Venki.