Link to home
Start Free TrialLog in
Avatar of mortonkr
mortonkr

asked on

VBA printing control

I am writing VBA code in a third party app and I need to create pages and have them printed. As it is not a VB6 app, I don't have access to the printer object which is found in VB6.olb. I found the printerserver.dll library helps but it wont let me print graphics!
When I try adding vb6.olb to the references in vba, the app crashes when run!
Any help would be great!
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

We need a bit more information...
1. VBA is not really a standalone programming language, ...typically it is associated with one of the MS Office Applications...
Which app are you building this for?
2.  " I need to create pages and have them printed."
...What does this mean?, ...what type of Pages? (report pages?, form pages?, web pages?

In other words, can you take a step back and explain to us the purpose of his application.

To be clear, vba does have tools to let you access the Printer collection:
https://msdn.microsoft.com/en-us/library/office/Aa223132%28v=office.11%29.aspx

 ...we just need to understand what this app is intended to do...

JeffCoachman
Avatar of mortonkr
mortonkr

ASKER

Hi Jeff,

The app is a SCADA package by Rockwell Automation and has no relation to Microsoft other than VBA.
I want to print a report including text and graphics. I have done this before by building a dll that accesses the vb.global printer object but this seems clumsy and it means I have to install vb runtime on the target machine (dll built with VB6).
There us no printer object in VBA with this app.
ASKER CERTIFIED SOLUTION
Avatar of Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial