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

    Print snapshot from VBA (Access 97 SR-1)

    Does anyone have a quick method for printing a snapshot file to a specific printer from VBA? The app I'm working on generates snapshots of reports and distributes them by email. Now they want to print a copy of each report as well. Any suggestions?
    Charlotte

  2. #2
    Lounger
    Join Date
    Apr 2001
    Location
    KY USA
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print snapshot from VBA (Access 97 SR-1)

    Is the issue actually printing the snapshot, or just getting the report printed at the time the snapshot is created? If you are wanting a print at the time the report is generated, just print the report. If you are trying to print the snapshot from an un-linked database on another machine, I'm not sure how to do that.

    Hope this helps,

    jd

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

    Re: Print snapshot from VBA (Access 97 SR-1)

    The issue is that the snapshot is created in code and distributed by email. Now the desire is to be able to designate reports to be distributed to particular printers as well as to email recipients. If the same report is supposed to be sent to multiple printers, I'll have to either find a way to send the snapshot to those printers or print the original report multiple times to different printers, which is much more involved. The overhead would be much lower if I could just send the snapshot without having to rerun the report one or more times.
    Charlotte

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Print snapshot from VBA (Access 97 SR-1)

    Could you use a form (hidden if necessary) with the snapshotviewer control on it, change the snapshot path property as necessary and use the printsnapshotdirect method?
    Regards,
    Rory

    Microsoft MVP - Excel

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

    Re: Print snapshot from VBA (Access 97 SR-1)

    I've thought of that but my boss is opposed to that solution since it requires distributing the snapview.ocx with the application. I may try it anyway, but I wondered if anyone knew of another method sans ActiveX control.
    Charlotte

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Print snapshot from VBA (Access 97 SR-1)

    I had thought of ShellExecute (or ShellExecuteEx) but can't figure out any way to pass it the printer you want to print to! <img src=/S/doh.gif border=0 alt=doh width=15 height=15>
    Regards,
    Rory

    Microsoft MVP - Excel

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

    Re: Print snapshot from VBA (Access 97 SR-1)

    Idle curiosity - if you are emailing the report, how does the recipient get the snapshot viewer so they can print the report?
    Wendell

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

    Re: Print snapshot from VBA (Access 97 SR-1)

    The client is responsible for distributing the snapshot viewer to his users. We include information about where to download it. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

    The idea here was to allow certain of the reports the application handles to be automatically sent to whatever printer the user designates so that the hard copy could be scooped up by engineers when they came into the office. This is a separate issue from the email attachments, which would have to be printed by the recipients if they wanted hard copies.
    Charlotte

  9. #9
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Faifax, Virginia, USA
    Posts
    542
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print snapshot from VBA (Access 97 SR-1)

    If you can move the database ... AXP contains a Printer object and a Printers Collection. These objects look pretty easy to use, a la
    Set Application.Printer = Application.Printers(0)

    Otherwise, I guess you are going to have to do some WinAPI calls.

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

    Re: Print snapshot from VBA (Access 97 SR-1)

    Alas, we won't be migrating the application to XP until the next full release version of the app.
    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
  •