+ Reply to Thread
Results 1 to 9 of 9

Excel printer tray media type

  1. #1
    Registered User
    Join Date
    12-03-2008
    Location
    Taunton
    Posts
    7

    Excel printer tray media type

    Hi All,

    I’ve been looking for several weeks now for a solution to this issue I hope someone can help.

    In our office I have several printers, I would like to be able to select a tray and select duplex printing, I have the code for this and it all works fine. However I have a tray that’s media type is set to letterhead this is within the printer driver and set on the machine itself this sorts out the age old issue of when letterheads are printed in duplex the correct pre-printed side of the page is printed on first. Duplex and plain paper media type tends to print on the wrong side first.

    As we have a lot of users on the network I can’t set-up macros for every application and user. So I’m looking for a way that excel can show a list of media types available on the printer and then set the correct media for the print job and then reset the media type to plain paper. Is this possible via a API call or Devmode?

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Excel printer tray media type

    You will have to find a methond to execute a macro

    Please Login or Register  to view this content.
    The above dialog accesses the printer setup/selection dialog.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    12-03-2008
    Location
    Taunton
    Posts
    7

    Re: Excel printer tray media type

    Keebellah

    Thank you for this, but I was hoping that the printer set-up changes could be done via code rather than an end user manual input.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Excel printer tray media type

    If you record a macro and then invoke all the steps using that dialog I indicated then you will see how to address the different paper sources and other printer settings.
    Since these are strictly printer related I cannot write you a macro when mine is a simple inkjet with no extra trays.
    If you would take the time to google and check out all the links you could find something

    http://stackoverflow.com/questions/2...a-vba-in-excel
    http://excelribbon.tips.net/T009178_...n_a_Macro.html
    https://www.safaribooksonline.com/li...3/ch11s03.html

    Asking is the shortest route, I agree, customizing the answer and putting it to work to your own requirements will cost a little more effort and sweat.

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Excel printer tray media type

    Just to show you I recorded a macro just looking at the settings and doing some things
    The result

    Please Login or Register  to view this content.
    You can do the same and then edit it to you further requirements.

  6. #6
    Registered User
    Join Date
    12-03-2008
    Location
    Taunton
    Posts
    7

    Re: Excel printer tray media type

    HI Keebellah,

    Thank you again for you input on this however I think I may not have been specific in my requirements.

    I need to find out and then change the paper types i.e. plain paper, thick 1, thick 2 etc. I've spent a lot of time goggling this and no one seems to have the answer.

    I have a lot of VBA code that handles other properties within the print job as you show above however I think I need an API or DEVMODE call to the printer itself and I was hoping for some help on how to achieve this.

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Excel printer tray media type

    What you are mentioning as what you put in the printer and the paper type is the user's decision, If you have a printer with 8 paper trays the it is only the user that knows which tray has which paper in it and all you have to do is choose the correct tray.
    So again, API or whatever except returning a status (out of paper, out of ink or toner and so, those are the printer escape codes (you can find a list of these codes on the manufacturer's sites) but the rest is up to you.
    My code above only shows the options my printer has, where is a HP with 4 trays, I could additionally tell it which tray to select, but the printer does not 'know' what is in it's tray.

    I hope you find what you're looking for.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Excel printer tray media type

    Hello bowlow,

    This will list the paper names and sizes for the default printer (active) for the user's computer.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Excel printer tray media type

    @Leith, nice, thanks for this, hope the OP can put it to use.
    I'm certainly going to take a good look at it

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Change default paper source tray in a specific printer using excel vba
    By jjq2r01h in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2014, 06:04 AM
  2. Getting excel file down to system tray when macro is running.
    By ganeshbabuphd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-08-2013, 05:32 AM
  3. Excel o system tray when running a macro
    By ganeshbabuphd in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-08-2013, 01:42 AM
  4. Printer Tray
    By Mike Archer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2006, 07:15 AM
  5. Print with paper from a specific printer-tray
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-28-2005, 08:05 PM
  6. Media Player versus Windows Media Player
    By teepee in forum Excel General
    Replies: 1
    Last Post: 10-13-2005, 10:05 PM
  7. [SOLVED] How do I change the paper tray from an Excel macro / vba module?
    By Jim in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-18-2005, 01:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1