Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5

    Unanswered: sending any file type straight to the printer

    i have an option group on a print form for the user to
    1. Print the cover page only
    2. Pick and choose what to print - where as I fill and make visible text boxes to represent the display file names from an image table and then clicking the file names I use the followhyperlink method to bring up the file to review and print

    3. The third option is "send all documents to printer" - This will recursively send files to the printer.

    Well this worked fiine with office files (Word , excel) bu then came pdf's where some machines had adobe reader , some do not, some have foxit , some do not, some have Blue beam, some do not - so the shell command per se is not valid because there is no way for me to to know which application there pdf files are associated with.

    So - is there any way to send a file straight to the printer regardless of association and without creating and killing the object.

    I have been trying to use the full Shell API

    apiShellExecute(hWndAccessApp, "print", _
    "c:\mytest" & rst!strFileName, vbNullString, vbNullString, 0)

    but it routinely throws back - file not found errors when in fact those files exist.

    Thank you in advance.
    Dale Houston, TX

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    I ran into this recently and found that removing the extention from the file name variable and/or changing the last argument to 3 worked. Not sure why, but it may be worth trying.

    strNewFileName = "c:\mytest" & left(rst!strFileName,len(rst!strFileName)-4)

    apiShellExecute(hWndAccessApp, "print", _
    strNewFileName & ".pdf", vbNullString, vbNullString, 3)

  3. #3
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    trying this now
    Dale Houston, TX

  4. #4
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    Worked greta Rogue

    lngreturn = apiShellExecute(hWndAccessApp, "print", _
    rst!imgpath1, vbNullString, vbNullString, 3)

    I di not even have too remove the extension

    thank you
    Dale Houston, TX

Posting Permissions

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