Usage: Open a second window for your document and set the zoom so the pages are thumbnail size.
Run the MakePagePreview macro from that window's menu.
Then whenever you click a page in the thumbnails window the main window will then go to that page.
Warning: NOT EXHAUSTIVELY TESTED - just to in OO only seems to work for me level: USE AT OWN RISK.
Code: Select all
Sub MakePagePreview()
dim oDocView,oMouseClickHandler
oDocView = ThisComponent.currentController
oMouseClickHandler = createUnoListener("PagePreviewH_", "com.sun.star.awt.XMouseClickHandler")
oDocView.addMouseClickHandler (oMouseClickHandler)
End Sub
Sub PagePreviewH_disposing(oEvt)
End Sub
Function PagePreviewH_mousePressed(Ev) As Boolean
' PagePreviewH_mousePressed = False
End Function
'
Function PagePreviewH_mouseReleased(Ev) As Boolean
dim fff1 as boolean,fff2 as boolean,pwin,fulltitle,title,a,i,ff,st2,f,pnumber,controller1,controller2,VC2
on error goto hr
pwin=ev.source.accessiblecontext.getaccessibleparent.accessiblecontext.getaccessibleparent.accessiblecontext.getaccessibleparent
fulltitle = pwin.accessiblecontext.titledbordertext
a= instr(1,fulltitle," :")
if a then
title = left(fulltitle,a-1)
else
a = instr(1,fulltitle," -")
title = left(fulltitle,a-1)
end if
ff = stardesktop.frames
for i =0 to ff.count -1
f = ff.getbyindex(i)
st2 = f.gettitle
if st2 =fulltitle then
controller1 = f.controller
fff1 = true
else
if st2 <>fulltitle and instr(1,st2,title)=1 then
controller2 = f.controller
fff2 = true
end if
end if
if fff1 = true and fff2 = true then exit for
next
pnumber = controller1.viewcursor.page
controller2.componentwindow.setfocus
wait 100
VC2 = controller2.viewcursor
VC2.jumpToPage(pnumber,false)
hr:
end function