?
Solved

printing my chart

Posted on 1998-08-11
1
Medium Priority
?
162 Views
Last Modified: 2010-04-30
I use Vb5 professional edition. I wanna know what is the easiest way to print MsChart control?
0
Comment
Question by:majala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
mtoft earned 120 total points
ID: 1468520
The Microsoft KB describes in article Q168749 how to print the
mschart control.

This is a slightly modified version of the Microsoft Example, using metafiles that will better the output quality.

' This function prints MSChart1 to the default printer.
Sub PrintChart()
    Dim mPic As StdPicture
   
    ' Fill the clipboard with data
    MSChart1.EditCopy
   
    ' Get picture from clipboard
    Set mPic = Clipboard.GetData(vbCFMetafile)
   
    ' Print the picture
    Printer.Print " "
    Printer.PaintPicture mPic, 0, 0, MSChart1.Width, MSChart1.Height
    Printer.EndDoc
   
    ' Remove ref to picture
    Set mPic = Nothing
End Sub


/Mtoft

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question