Solved

printing my chart

Posted on 1998-08-11
1
151 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
1 Comment
 
LVL 2

Accepted Solution

by:
mtoft earned 30 total points
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now