Results 1 to 5 of 5
  1. #1
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    set zoom on Print Preview (Excel 2003)

    I have code that prints a pre-formatted page (an invoice) and I display it in Preview mode for the user just before it's printed. The text is kind of small so I wanted to click the 'Zoom' button on the top of the preview window but I can't find a way to do that in code. Recording a macro didn't reveal any hints. The help says that the .Zoom property of PageSetup only affects the page when it's printed, not as previewed. I played with "Activewindow.PageSetup.Zoom=80" but that doesn't do anything to the preview mode zoom.

    I have this code <pre> ActiveSheet.PrintOut Copies:=1, preview:=True</pre>

    and it'd be nice if there was an additional "zoom:=80" or something to that affect. How about SendKeys? Any ideas?

    I searched the Lounge and found other posts on Zoom but not for Preview Mode.

    Thnx, Deb

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: set zoom on Print Preview (Excel 2003)

    <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29> Are these methods of any use?

    ActiveWindow.View = xlPageBreakPreview
    ActiveWindow.Zoom = 50

    (I know, they aren't Print Preview)
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: set zoom on Print Preview (Excel 2003)

    As far as I know, print preview doesn't support a zoom percentage, only "normal" (100%) and "whole page". You could issue

    SendKeys "Z"

    before

    ActiveSheet.PrintPreview

  4. #4
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: set zoom on Print Preview (Excel 2003)

    I think I tried that but it affects the sheet that's printed not the preview of the sheet. This sheet is normally hidden and is ppoulated by code when the hit an "Invoice" button. I wanted to show them a preview of what they'll get in case they want to cancel and re-do something before getting the final printout.

    Deb

  5. #5
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: set zoom on Print Preview (Excel 2003)

    Hey, yes that did it !

    <pre> On Error Resume Next ' in case they cancel
    SendKeys "Z"
    ActiveSheet.PrintOut Copies:=1, preview:=True</pre>

    Works great!!

    Thnx, Deb <img src=/S/bow.gif border=0 alt=bow width=15 height=15>

Posting Permissions

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