Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Unanswered: Dim prn As Printer reference

    Is there a specific reference to use:

    Dim prn As Printer

    I get a user-defined object error on "Printer" when debugging.
    Last edited by pkstormy; 10-26-07 at 16:13.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    Access library, I think, starting with the 2002 (xp) version.
    Roy-Vidar

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    ok...I have the typical Access references. Am I missing something? I tried adding in a whole bunch of other references but to no avail. When you say Access libraries I'm not sure I understand. I'm going to try it on my machine at home but I seem to be missing something here at the City.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    "Access library", part of Access.Application - so not a library per see - not VBA, not DAO, not ADO... but Access. And, as said, it is not present in 2000 and earlier versions, only starting with 2002 (xp) and later versions.
    Roy-Vidar

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Thanks for the reply Royvidar. I'll do some researching. You're right - at home on 2002, Printer is available.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Can you late bind the thing?
    What are you trying to achieve Paul?

    I have this link bookmarked from a while ago - have been meaning to look into it, perhaps it will help you in your search.

    http://msdn.microsoft.com/archive/de...softAccess.asp
    George
    Home | Blog

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    George,

    I need to write some code to make pdf files on a dozen reports. Problem is that there will be dozens of users doing this all of who have installed either a freeware pdf creating program or have different Acrobat Writer versions. I was going to use the Dim Prn as Printer as part of the code to set the printer to the adobe PDF driver.

    Thanks for the link. I'll see if I can utilize it somehow in my code at work with the pdf code.

    My gameplan is to show a listbox of available printers/PDF Drivers where the user selects the Adobe PDF driver and then clicks the button to create the pdf files. I'd like to automate the creation of the pdf files naming them with set names I have for them (the user only having to select the folder to save them.) Problem is, when they select the Adobe PDF driver and click the button to create PDF's in the folder they've specified, it will still prompt them for the pdf file name and location to save it to.

    I'm really beginning to dislike adobe and all the driver versions they have (at least they could have remained consistent on the names for the drivers)...Acrobat Distiller, Acrobat Writer, Adobe PDF, etc...etc... (C'mon Adobe - people are trying to write code to utilize your drivers and you're not making it easy by naming each version a different name!)
    Last edited by pkstormy; 10-28-07 at 02:31.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  8. #8
    Join Date
    Feb 2007
    Posts
    348
    Paul,

    Did you ever get this printer thing tackled? I would love to see what you have so I could learn up a bit on how to manipulate the printers via Access.

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    It seems to only work with Access 2002/XP and above. Everything I've found so far seems to indicate RoyVidar is correct on it working only with those versions. I found another way around it since it was mainly for creating PDF files and I used the code I found to create PDF's so the dim PRN as Printer was not needed. I'll see if I can find out more info though.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •