Solved

Printing a chartspace object  with VBA

Posted on 2002-03-26
9
1,467 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:JoAerts
[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
  • 5
  • 3
9 Comments
 
LVL 5

Expert Comment

by:chewhoung
ID: 6898493
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
 
LVL 5

Expert Comment

by:chewhoung
ID: 6898499
0
 

Author Comment

by:JoAerts
ID: 6901872
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:chewhoung
ID: 6902151
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
 

Author Comment

by:JoAerts
ID: 6904651
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
 
LVL 5

Expert Comment

by:chewhoung
ID: 6904706
-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
 

Author Comment

by:JoAerts
ID: 6907613
But the source of an imagebox can't change, and the chart does... does that still work?
0
 
LVL 5

Accepted Solution

by:
chewhoung earned 300 total points
ID: 6908470
you can programmatically change your source of image:

me.image0.picture = "your image location here"
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7064335
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

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

740 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