Printing a chartspace object with VBA

I have included a chartspace object in VBA. But now I want to use a button that prints the chartspace object. I've tried using Printer.PaintPicture but that doesn't work in VBA. I've exported the picture to a imagefile so a function to print an imagefile that's on disk will do also.

Thnx
JoAertsAsked:
Who is Participating?
 
chewhoungConnect With a Mentor Commented:
you can programmatically change your source of image:

me.image0.picture = "your image location here"
0
 
chewhoungCommented:
Here's some idea:

How to Print a VB Picture Control Using Windows API Functions
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q77060

you may have to use the image control in Access....
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
JoAertsAuthor Commented:
But it seems I can't create a picturebox in VBA, I tried

Dim picBox as PictureBox
Set picBox = new PictureBox but that doesn't work, any suggestions?
0
 
chewhoungCommented:
As I said, you have to use the image control... there is no picture box control in access.
Try convert the code from vb to vba....
0
 
JoAertsAuthor Commented:
I'm sorry, didn't see that. But I don't have the knowledge to do that. So If anyone is willing to help me, i've increased the points to 300.
0
 
chewhoungCommented:
-Just create a new report, blank one
-put a image box in
-select your image file
-preview it, if its ok mean that is what you will get when printed
-next, have a button at your form to print the report

put this code in to print the report

    DoCmd.OpenReport "ReportName", acNormal
0
 
JoAertsAuthor Commented:
But the source of an imagebox can't change, and the chart does... does that still work?
0
 
nico5038Commented:
for JoAerts

No comment has been added for the last two months.
So it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
 - Answered by: chewhoung  
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.