Private Sub Command1_Click() With MSChart1 .EditCopy End With Picture1.Picture = Clipboard.GetData(CF_BITMAP) Printer.PaintPicture Picture1.Picture, 100, 100 End Sub
'打印mschart的内容 Private Sub mnuPrint_Click()MsChart1.EditCopy 'copies a picture of the chart '(meta file format) and the chart data to the clipboard'adjust the coordinates to suit your needs Printer.PaintPicture Clipboard.GetData(vbCFMetafile), 0, 0, _ MsChart1.Width, MsChart1.HeightPrinter.EndDoc 'sends the chart to the printerClipboard.ClearEnd Sub
With MSChart1
.EditCopy
End With
Picture1.Picture = Clipboard.GetData(CF_BITMAP)
Printer.PaintPicture Picture1.Picture, 100, 100
End Sub
Private Sub mnuPrint_Click()MsChart1.EditCopy 'copies a picture of the chart
'(meta file format) and the chart data to the clipboard'adjust the coordinates to suit your needs
Printer.PaintPicture Clipboard.GetData(vbCFMetafile), 0, 0, _
MsChart1.Width, MsChart1.HeightPrinter.EndDoc 'sends the chart to the printerClipboard.ClearEnd Sub