Printing VB Userform in Excel-VBForums
Results 1 to 4 of 4

Thread: Printing VB Userform in Excel

  1. #1

    Thread Starter
    Super Moderator Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    11,928

    Question Printing VB Userform in Excel

    Hi

    i want to print the userform created in excel. the command that i am using is

    userform.printform

    the problem is that the userform is so big that it is not fitting in one page. is there any way i can change the orientation to 'landscape' (using vbcode) and then take a print of the current userform??? or is there any other way to print it?

    thanks

    more info: the height of userform is 405 and width is 725. there is a commandbutton in the userform that uses the above code to print the userform. it does print perfectly. it's just that it takes two pages to print...
    Last edited by Siddharth Rout; May 3rd, 2006 at 07:38 AM. Reason: more info added

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,128

    Re: Printing VB Userform in Excel

    There is no standard support for this bt you may be able to work around it by using some APIs like BitBlt to resize the image and fit it to a single page. I am not familiar enough with it to provide an example but here is a link for the API.

    http://www.allapi.net/apilist/BitBlt.shtml
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 300 GB HDs, 2 GBs DDR2 667 MHz RAM, 2 Viewsonic 24" LCDs, Windows 7 SP-1/Windows 8.1, Office 2010, VS 2013

  3. #3

    Thread Starter
    Super Moderator Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    11,928

    Re: Printing VB Userform in Excel

    thanks rob

    i visited the site but everything went qbove my head

    so i tried the most common way. i simply typed "printing userforms in excel" in google and searched. i was surprised by the links it pulled up. seems like i am not the only one who is facing this problem

    anyways i just had a thought. i am not sure if this is possible.... can we change the orientation on the printer properties in Control Panel|Printer to landscape and back to potrait through VB code????

    I am sure there definitley has to be a way....

    I am still searching the web. in case i come across anything, i'll definitely update this thread...

    Thanks once again...

  4. #4

    Thread Starter
    Super Moderator Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    11,928

    Re: Printing VB Userform in Excel

    I JUST FOUND SOME THING THAT MIGHT HELP....

    WILL GIVE IT A TRY AND SEE IF IT WORKS....

    http://groups.google.com/group/micro...652a998c2a44c4

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.