Tony, thanks for your quick response.
It is a multi user progam in Access. Problem is, every user has different
printers. I want to use a A3 printer not everyone has (some reports are
designed on a A3 paper). I want so set the printer name before printing.
I am a advanged programmer, but it is a lot of work and pain in the ass. I
guess it will cost me one day before i solved all GPF's I will encounter
when I do all the work from the beginning.
I allready have code to set printer margins, paper size and orientation. I
first open the report in design mode, make the changes, and then open the
report in preview mode. This works.
It spare me a lot of time, when i have some working code and all Windows Api
function declarations i need.
Peter
"Tony Toews" <tt****@telusplanet.net> wrote in message
news:30********************************@4ax.com...
"bla" <da@chello.nl> wrote:
Does anybody have working sample VBA code to change printerdriver in a
report and to get a list of available drivers and there functionality?
Do you mean you want to change printers termporarily? Then you don't need
prtDevMode and such. Which are a lot of work.
You can change the default printer using updates to the INI file and some
sample code. See DefaultPRT.ZIP at http://www.mcwtech.com/downloads.htm
Finally you can use DevPrtMode however this requires extensive VBA
knowledge and is not for the faint of heart. Also this won't work in MDEs as you must open
reports in design mode although you can use Automation to open a reports MDB and
manipulate it there.
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm