zoom macro

  • hi all


    iam trying to make a macro so that i can toggle between 45 & 75% view tha iam going to put on a tool bar in MS Word 2000. this is how far iv got with the code when i click no the button it go's to 75 % and stays there it does not go to 45% if i click on the button again can some one help me


    ActiveWindow.ActivePane.View.zoom.Percentage = 45
    ActiveWindow.ActivePane.View.zoom.Percentage = 75

  • Re: zoom macro


    Hi,


    The last command, of 75% will always override the 45% setting.
    You need to check the current setting and then set to the other value.
    Note this will only set the zoom to 75 is the current setting is 45. All other zoom setting will cause it to be set to 45.
    [vba]
    if ActiveWindow.ActivePane.View.zoom.Percentage = 45 then
    ActiveWindow.ActivePane.View.zoom.Percentage = 75
    else
    ActiveWindow.ActivePane.View.zoom.Percentage = 45
    endif[/vba]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!