Paste an Excel Chart in an Outlook Body



I am trying to paste an excel shart in the body of an outlook message.
I already managed to do this through exporting the chart and then
importing, but the chart loses a lot of quality so I am trying to find
a way to paste the chart through the clipboard.

the only thing missing in my code would be the procedure to paste the
chart that is already on the clipboard. here's what I have:

Sub SendEmail()

Dim theApp, theNameSpace, theMailItem, myAttachment, Msg


'create a new Outlook Application Object,
'direct it to the proper NameSpace,
'create a new Mail Item and set the attachments collection
Set theApp = CreateObject("Outlook.Application")
Set theNameSpace = theApp.GetNamespace("MAPI")
Set theMailItem = theApp.CreateItem(0)
Set myAttachment = theMailItem.Attachments
theMailItem.Display


' campo mensagem '
Workbooks.Open "Test.xls"
Sheets("Sheet1").Select
ActiveSheet.ChartObjects("Grafico").Activate
ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen,
Format:=xlPicture
Sheets("Sheet1").Cells(1, 1).Select

'add recipients to MailItem
theMailItem.Recipients.Add "test@xxxxxxxx"
theMailItem.subject = "Anything"
theMailItem.Body = Msg

theMailItem.Send
theNameSpace.Logoff


End Sub


I found the code below on this same newsgroup that supposedly would do
the job, but it is not working. Does anyone know why?

Sub Pastebody()
Set tmpBody =
Item.GetInspector.ModifiedFormPages("Message").Controls("Message")
tmpBody.SetFocus
Item.GetInspector.CommandBars.Item("Menu
Bar").Controls("Edit").Controls("Paste").Execute
End Sub

Thanks

.



Relevant Pages

  • Re: Problem using arrays in Excel Charts from VBA
    ... The first creates a chart from an array. ... Sub ChartSeriesLengthOK() ... ReDim x ... The final approach adds a worksheet that is immediately hidden. ...
    (microsoft.public.excel.programming)
  • Re: How do I offer ChartType options?
    ... a chart's source data range first, ... Your post executes the OB1 click event on UF ... > < Private Sub UserForm_Initialize ... > the CharttType routine, assuming neither OB1 nor OB2 are defaulted to True ...
    (microsoft.public.excel.charting)
  • RE: Trouble selecting chart in macro
    ... select the rectangle object and place it behind the chart, then regroup. ... Sub Macro2() ... if the rectangle is behind the chart then srrefers to ...
    (microsoft.public.excel.programming)
  • Wrong columns sometimes selected -->?
    ... check on the source data for the chart, ... Sub FixCreateAndPrintAllCharts() ... Dim StartDir As String ... With Selection ...
    (microsoft.public.excel.programming)
  • Re: Wrong columns sometimes selected -->?
    ... check on the source data for the chart, ... Sub FixCreateAndPrintAllCharts() ... Dim StartDir As String ... With Selection ...
    (microsoft.public.excel.programming)