Solved

Printing a chartspace object  with VBA

Posted on 2002-03-26
9
1,440 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

706 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

19 Experts available now in Live!

Get 1:1 Help Now