Solved

Printing a chartspace object  with VBA

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

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

808 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