现在我需要将MSChart控件上所显示的图表用A4的纸打印出来,请问用什么方法能将其打印?希望给出具体的代码,谢谢!!

解决方案 »

  1.   

    Private Sub Command1_Click()
        With MSChart1
            .EditCopy
        End With
        Picture1.Picture = Clipboard.GetData(CF_BITMAP)
        Printer.PaintPicture Picture1.Picture, 100, 100
    End Sub
      

  2.   

    '打印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