Solved

Printing a chartspace object  with VBA

Posted on 2002-03-26
9
1,478 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
 

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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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 …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

734 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