Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sydney, Australia, New South Wales, Australia
    Posts
    251
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Common Dialog box (Access 2000)

    I have a need to open a common dialog box (the printer dialog) via code from Access, retrieve the details and then use those details for my own purposes.
    I could create a form with the required fields, but filling the printer list is a bit messy. In plain VB the common dialog boxes are easy to pop up. How do I do it from within Access?
    Thanks for your help.
    Peter

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Common Dialog box (Access 2000)

    Welcome to the differences between Access and VB. One is that the common dialogs are NOT as easy to work with. The usual way to get printer information from Access is to use PrtDevNames, but that relates to the devices available for printing reports, etc. from Access. You can always use the WinAPI to give you a handle into the PrintDev library. What are you trying to popup the print dialog for?
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sydney, Australia, New South Wales, Australia
    Posts
    251
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Thanks

    I suspected that it was going to be difficult. Why oh why does MS do this to us? A bit of consistency would eb nice (but I guess things have come a long way!).
    I just wanted an easy way to get the users to choose which printer and how many copies. I'll have to create my own form for it.
    Thanks again for your help.
    Peter

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Thanks

    I'm still puzzled - doesn't the standard Access print dialog box you get with File/Print give you the choice of any printer defined on the workstation?
    Wendell

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sydney, Australia, New South Wales, Australia
    Posts
    251
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Re: Printer dialog box

    Well, yes it does. But I don't want to print any Access object, I want to print some Adobe Acrobat PDFs from within Access. (It's along story, but basically I'm using an Access database as a repository and index to a pile of documents.) So I need to print those docs out from within Access. I've found the right cmd line switches to get it to work, from the VBA forum on Woodys. I'll allow the user to choose the printer and number of copies, then Access will be shelling to Acrobat to print the documents.

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Printer dialog box

    Can't you print from the Acrobat OCX?
    Charlotte

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sydney, Australia, New South Wales, Australia
    Posts
    251
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Re: Acrobat OCX

    Good question. I'm not sure if you can. I couldn't find any doc on Adobe's website about it, except for the information below (Support Knowledgebase Document 320325)
    -------------------------------------------------------------------------
    ActiveX Control in Acrobat 4.0 and Later Is Not Full-Featured Control

    Adobe Acrobat 4.0 and later includes an ActiveX control for Windows. This control enables Microsoft Internet Explorer to display Adobe PDF files in the browser window using an Acrobat viewer, such as Acrobat or Acrobat Reader. This ActiveX control is for use only with Internet Explorer; it is not a full-featured, robust ActiveX control that enables other applications to display PDF files.
    -------------------------------------------------------------------------

    Maybe there is some undoc'd features there?
    In the future, I can see I'll need to use Access to drive printing of other doc types as well, that may not have a control. So cmd line options seemed more appropriate.
    I was hoping for a command on a printer object that could just take a filename, figure out what the association was from that files extension (from the registry - e.g. PDF uses Acrobat) and send it to the printer. Certainly Windows can do that - just drag and drop an object onto a printer shortcut. But I want to do it via VBA. Something like this would have been nice:
    <pre>Dim myPrinter As Printer
    myPrinter.Name = "W2Plain Paper"
    myPrinter.PrintObjectName = "stuff.pdf"
    myPrinter.Print
    </pre>


    Anyone from MS reading this?

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Acrobat OCX

    Take a look at this thread in VB/VBA/.Net where something similar was being attempted by VB.

    MS people reading it won't help, because they don't own Acrobat ... yet! <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15> The ocx is installed if you install Acrobat reader on a machine too.
    Charlotte

Posting Permissions

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