Discussion:
(VBA) how to zoom with idFitWindow
(too old to reply)
garcĂ­
2006-09-16 08:27:16 UTC
Permalink
In Visual Basic I have this sub. Everything is OK with the exception of the last line (markes with ****) I lack general knowledge about how all those 'id' work. I have tried many possibilities, but so far there's always some kind of error about objects. (InDesign CS)

Private Sub pageminusbutton_Click()
' This button is to go to the previous page
' and to update the namebox that indicates
' the current page
Set myindesign = CreateObject("InDesign.Application.CS")
Set mydoc = myindesign.ActiveDocument
Set currentpage = myindesign.ActiveWindow.ActivePage
numpag = currentpage.DocumentOffset
myindesign.ActiveWindow.ActivePage = mydoc.Pages.Item(numpag - 1)
Set currentpage = myindesign.ActiveWindow.ActivePage
namebox.Text = currentpage.Name

* ***** myindesign.WindowState = idGoToZoomOptions.idFitWindow

End Sub
D***@adobeforums.com
2006-09-16 08:48:15 UTC
Permalink
Your "myindesign" is the application.
Application has no WindowState property, windowstate is unknown at all.

There is a difference between
- GoToZoomOptions, used by Behaviors of interactive elements
- ZoomOptions, used by the LayoutWindow.zoom(zo)

I don't know VBA therefor I can't help you with the exact mangling of the enum names.
Here are the values (JavaScript encoded):
ZoomOptions.zoomIn = 2053990766; // 'zmin'
ZoomOptions.zoomOut = 2054124916; // 'zout'
ZoomOptions.fitSpread = 2053534835; // 'zfts'
ZoomOptions.fitPage = 2053534832; // 'zftp'
ZoomOptions.showPasteboard = 2054385762; // 'zspb'
ZoomOptions.actualSize = 2053206906; // 'zasz'

Hth,
Dirk

Loading...