+ Reply to Thread
Results 1 to 4 of 4

VB Code to Quick Print without opening Printer Dialog and keeping default setting intact

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to Quick Print without opening Printer Dialog and keeping default setting intact

    Hello:

    Please refer to attached file.
    I need VB Code to do followings.
    I have number to network Printers and Microsoft Print to PDF in the list of printers.
    I am interested in printing in "Microsoft Print to PDF" and keep default setting to Portrait.

    I need VB Code to automatically print the data with file name in cell K11 in Microsoft Print to PDF in Landscape mode without displaying
    the printer dialogue and leaving the default setting.
    If setting of the Printer is changed to Landscape from Portrait, then would need to chnage it back to default setting.

    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: VB Code to Quick Print without opening Printer Dialog and keeping default setting inta

    .
    There is PRINT and there is PRINT TO PDF which is actually saving the document as a pdf file.

    Do you want to physically PRINT the range ? Or do you want to save it as a pdf ?

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to Quick Print without opening Printer Dialog and keeping default setting inta

    Hello Logit:

    Let me explain you my purpose.
    I have Web Application which has PRINT for Label Printing and Report Printing.
    When i am in Label Printing, pressing PRINT will open up Printer Dialogue and here i choose Zebra Label Printer and set Portrait layout.
    When i am in Report Printing, pressing PRINT will open up Printer Dialogue and here i choose "Microsoft Print to PDF" printer and set Landscape layout.

    After printing out the report, i have to go back to Printer setting to change it to Label Printer with Portrait mode...
    As you can see its lot of manual interference i have do and have to remember changing printer setting depending on either Label Printing or Report Printing.

    So if i need to Print Report then i run the code to basically change printer setting as required rather then manually doing it



    Basically my purpose is to have VB Code which will basically Select Printer "Microsoft Print to PDF" with Landscape mode in the background and nothing change in the actual setting.
    This way i would not have to keep on changing Label Printer to Portrait mode etc

    Its complicated but i hope it have made it clear.

    Thanks Logit.

    Riz
    Last edited by rizmomin; 04-12-2019 at 09:04 PM.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: VB Code to Quick Print without opening Printer Dialog and keeping default setting inta

    .
    Paste this macro into a Routine Module :

    Please Login or Register  to view this content.
    The macro will same the ACTIVE SHEET to your desktop as a PDF file in landscape orientation.

+ 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. [SOLVED] Solution to changing Default printer code when printer changes
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-28-2016, 03:12 PM
  2. [SOLVED] Setting and changing default printer
    By bigfishprf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2016, 05:49 PM
  3. Setting the default printer
    By martinpgibson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-19-2013, 05:43 PM
  4. Printing Macro Problem - Setting Default printer
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2012, 03:37 AM
  5. macro to print 2 copies to default printer, then 1 copy to Adobe PDF printer
    By jwright650 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2011, 01:07 PM
  6. Code to print all files in a folder (to default printer)
    By jwhitwell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2010, 04:35 PM
  7. Setting default printer using wsh
    By PO in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-14-2005, 04:06 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