How zoom in and out with a keyboard shortcut in MS Word 2013?

12,856

Solution 1

AFAIK there's no keyboard shortcuts specifically for zooming.

Instead, create these two new VBA routines (macros):

Sub MyZoomIn()
  Dim iZoom As Long
  iZoom = ActiveWindow.View.Zoom
  iZoom = iZoom + 5
  ActiveWindow.View.Zoom = iZoom
End Sub

Sub MyZoomOut()
  Dim iZoom As Long
  iZoom = ActiveWindow.View.Zoom
  iZoom = iZoom - 5
  ActiveWindow.View.Zoom = iZoom
End Sub

Source

Then assign keyboard shortcuts to them:

  1. Click the File tab.

  2. Click Options.

  3. Click Customize Ribbon, and then click Customize.

  4. In the Save changes in box, click the current document name or template that you want to save the keyboard shortcut changes in.

  5. In the Categories box, click the category that contains the command or other item that you want to assign a keyboard shortcut to or remove a keyboard shortcut from.

  6. In the Commands box, click the name of the command or other item that you want to assign a keyboard shortcut to or remove a keyboard shortcut from.

    Any keyboard shortcuts that are currently assigned appear in the Current keys box.

  7. Assign a keyboard shortcut:

    a. Begin keyboard shortcuts with CTRL or a function key.

    b. In the Press new shortcut key box, press the combination of keys that you want to assign. For example, press CTRL plus the key that you want to use.

    c. Look at Currently Assigned to see if the combination of keys is already assigned to a command or other item. If so, select a different combination.

    d. Click Assign.

Source

Solution 2

I would take TECHIE007's answer a step further, by adding the following code to a module in Normal.dotm:

Const FineZoom As Double = 5
Const CoarseZoom As Double = 25
Const MaxZoom As Double = 500
Const MinZoom As Double = 10

Sub ZoomInFine()
    With ActiveWindow.View
        If .Zoom <= (MaxZoom - FineZoom) Then .Zoom = .Zoom + FineZoom
    End With
End Sub

Sub ZoomOutFine()
    With ActiveWindow.View
        If .Zoom >= (MinZoom + FineZoom) Then .Zoom = .Zoom - FineZoom
    End With
End Sub

Sub ZoomInCoarse()
    With ActiveWindow.View
        If .Zoom <= (MaxZoom - CoarseZoom) Then .Zoom = .Zoom + CoarseZoom
    End With
End Sub

Sub ZoomOutCoarse()
    With ActiveWindow.View
        If .Zoom >= (MinZoom + CoarseZoom) Then .Zoom = .Zoom - CoarseZoom
    End With
End Sub

To do this, open a blank document in Word, and then:

  1. Open the VBA Editor by pressing Alt+F11
  2. Find "Normal" in the Project Explorer, right-click, then select 'Insert' and 'Module'

VBA snip

  1. Copy and paste the above code into the newly-created, blank code module.
  2. Save the VBA code (Ctrl+S) and close the VBA Editor

Using TECHIE007's instructions, I then would bind:

  • ZoomInCoarse to Ctrl+Shift+Numpad +
  • ZoomOutCoarse to Ctrl+Shift+Numpad -
  • ZoomInFine to Ctrl+Alt+Shift+Numpad +
  • ZoomOutFine to Ctrl+Alt+Shift+Numpad -

This form of the code allows a tunable rate of zoom, with automatic detection of zoom limits to avoid VBA runtime errors. If the fine and/or coarse zoom rates, or the zoom limits, are not to one's liking, they can readily be changed.

The behavior could be further customized by, e.g., adding macros that set particular favorite levels of zoom and binding shortcut keys.

Share:
12,856

Related videos on Youtube

AMDG
Author by

AMDG

Updated on September 18, 2022

Comments

  • AMDG
    AMDG almost 2 years

    I want to avoid using the mouse, touchpad or moving cursor to the down right corner "ruler" but I could not find a keyboard shortcut to Zoom in/out in a crecendo and decrecendo way. The only one I found is "Zoom100" but that is not what I'm looking for.

    Is there a way to do this with a MS macro or using autohotkey?

    • Matt
      Matt over 9 years
      ALT WQE [some number] enter.. but that is horrible. Apparently no native shortcut exists for zoom in/ zoom out
  • AMDG
    AMDG over 9 years
    is this just ONE macro to be installed as a regular macro inside Word? or four different macros
  • hBy2Py
    hBy2Py over 9 years
    Four different macros, but they all need to go in a single code module.
  • AMDG
    AMDG over 9 years
    at the MS Visual Basic should I right click "Modules" then "Insert" then "Module" and then paste that whole code? or should I right click the folder below "Modules" that is "NewMacros" and "Insert" and "Module". i'm not familiar with that and I'm afraid to affect all my macros
  • hBy2Py
    hBy2Py over 9 years
    I'll edit my answer with some screenshots and instructions when I get the chance. Early next week at the latest.
  • AMDG
    AMDG over 9 years
    I wait for that. Is it going to work also in Outlook message?
  • hBy2Py
    hBy2Py over 9 years
    Probably not, I think you'd have to add the code separately to a module in Outlook's VB Editor, tweaking it to match Outlook's internal construction. The macros could likely be adapted to OL though.
  • AMDG
    AMDG over 9 years
    excellent! it works! how can I get to know how to tweak it for Outlook?
  • hBy2Py
    hBy2Py over 9 years
    Outlook's VBA model is quite limited - I don't see a way to add keyboard shortcuts for zooming. However, you can zoom in/out by holding <kbd>Ctrl</kbd> and rolling the mouse wheel, if you have one.
  • AMDG
    AMDG over 9 years
    but I have a new touchpad that does not allow me to do that. Along with that I posted here another question somewhat related, any clue for that? superuser.com/questions/861092/…
  • hBy2Py
    hBy2Py over 9 years
    My touchpad will scroll if I slide my finger up and down the right-hand edge of it. Zooming works for me (in Chrome, at least) to hold Ctrl and slide a finger up and down on the right edge. AFAICT, a macro like the above for Outlook requires a level of access to the document object model that VBA just doesn't provide.
  • AMDG
    AMDG over 9 years
    my new touchpad does not have that right-hand edge as the previous one. Even thought that were possible there is nothing, at least for me, to work directly over the keyboard. But now I'm more urged because of the new touchpad. So there is no solution for this? MS supposedly being so professional? (:
  • Sreenikethan I
    Sreenikethan I over 3 years
    this may be the last resort