+ Reply to Thread
Results 1 to 6 of 6

Allow user to select printer but print with my defined settings

  1. #1
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2010
    Posts
    179

    Allow user to select printer but print with my defined settings

    All,

    I have created a spreadsheet from which I want to print a report with set settings. What I would like is for the user to be able to select the printer they wish to print from (from the ones available to them - this could be printed anywhere around a large company) but then for the document to be printed with the settings that I choose for them. Is this possible? Here is my current code (note the use of "Application.Dialogs(xlDialogPrint).Show" to bring up the dialog box, but this will change the print settings I have defined).


    Please Login or Register  to view this content.
    Thanks in advance.
    Did I help? Click *- add to my rep.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Allow user to select printer but print with my defined settings

    Below is the code I use for getting the list of printers a user has. It's not my code but unfortunately I can't remember where I got it from. Anyway it may be of help - at the end I use the loop to populate a listbox on a userform that the user can then use to select a printer.
    Please Login or Register  to view this content.
    End Sub

  3. #3
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Allow user to select printer but print with my defined settings

    Hi yudlugar,

    So do I need to create a form with a listbox on it and enter this code in there? Bit confused as to how I put this into mine. Thanks for the help though, it looks great.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Allow user to select printer but print with my defined settings

    I have it in a separate module, so if I make a print macro it would have:
    Please Login or Register  to view this content.
    depending on how you set up the userform, you need to put some code in it for when the user clicks a button, so mine has a commandbutton with ok and the code:
    Please Login or Register  to view this content.
    which takes me back to the print macro.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Allow user to select printer but print with my defined settings

    not perfect but you could use
    Please Login or Register  to view this content.
    to select the printer
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  6. #6
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: Allow user to select printer but print with my defined settings

    Thanks for your help yudlugar. Your advice pointed me towards another site that helped me.

    http://www.cpearson.com/excel/GetPrinters.aspx

    Very useful document in there that explained it all. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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