garcĂ
2006-09-16 08:27:16 UTC
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
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