Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is it possible to use a custom zoom instead of the standard :
25% 50% 75% 100% 125% 150% 175% 200% 400%
I know i can use the 'Fit Zoom to Window' option, but i would like if possible the user to input a zoom level themselves using an input box or selecting from a list box.
Thanks
any update on this?
Hi,
You can use a macro and set in document properties, Triggers / Filed Event Triggers / On Selection
Set a external / Run Macro
Create macro and set then
SUB ZOOM
set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = ActiveDocument.Fields("YOUR_FIELD").GetSelectedValues.Item(0).Text
mysheet.SetProperties sp
END SUB
Thanks Eduardo.
What do i put instead of YOUR FIELDS though? I want to change the zoom on the enire sheet not a specific field. or am i missunderstanding it?
Hi,
YOUR_FIELD reference a number of zoom that you want.
TABLE_ZOOM:
0.10
0.20
0.30
...
This zoom will be reflected in you sheet.
I have played with this once.
Here is a macro built around a variable called "zoom" (default value: 100%).
The variable has "on input" trigger which runs the macro.
You can change the variable via slider or buttons.
Have fun!
sub zoom
zoomvalue = ActiveDocument.Evaluate("num(zoom)")
set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = zoomvalue
mysheet.SetProperties sp
ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
end sub
Thanks Tanel.. I am getting an error when tring to run the macro
the edit module box appears with the error:
Type mismatch: 'sp.ZoomFactor'
Have you got an example of this working you could upload please??
should be working. Try variable value 1 then 1.1 or 0.9.
If still error, it could be local settings issue (decimal sep). Then use integers (100, 110) in variable and make division in macro:
change this line to: sp.ZoomFactor = zoomvalue * 0.01
Hmm, still not working. It doesnt like 'zoomvalue'....
Can you confirm that this is right please?
I'm lost now 😞
sub zoom
zoomvalue = ActiveDocument.Evaluate("num(zoom)")
set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = zoomvalue * 0.01
mysheet.SetProperties sp
ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
end sub