Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Go To Page?
Go To Page?
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
yoxi
Cipher


Joined: Sep 07, 2004
Posts: 1799
Location: Dawlish, Devon

PostPosted: Sun Dec 02, 2007 2:25 pm    Post subject: Go To Page?

Sorry if this question has an obvious answer somewhere in Help or these fora, I've not been able to find it... but is there a Neo/OOo equivalent for Word's Go To Page cmd-G? And if not, has anyone written a macro to do this, that you know of?

- padmavyuha
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Sun Dec 02, 2007 3:06 pm    Post subject:

There's a "Jump to Page" box in the Navigator window.

In Tools>Customize>Keyboard, it is the "To Page" function in The "Navigate" category. That pullsup the Navigator window and puts the cursor in the Jump to Page box.

Maybe there's an easier way?

Lorinda
Back to top
yoxi
Cipher


Joined: Sep 07, 2004
Posts: 1799
Location: Dawlish, Devon

PostPosted: Sun Dec 02, 2007 6:37 pm    Post subject:

I found this macro on this OOoForum thread - seems to work nicely, though it's a bit of a huge display box, and I haven't found a way yet to make it less wide.
Code:
Sub GoToPage 'Written by JohnV
Def = PriorPjcv
Def = Lcase(Def)
oVC = thisComponent.CurrentController.getViewCursor
CurrentP = oVC.getPage
If Not ShowDef then Def = ""
Info = "Current Page = " & CurrentP
If PriorPjcv <> "" then Info = Info & "  Prior Page = " & PriorPjcv
a$ = "Enter Page Number Below. "
a$ = a$ & "However, if Front Matter exists, add a space and an offset. "
a$ = a$ & "For example, 7 14 will go to Page 7 after Roman Page XIV. "
a$ = a$ & "To jump by n pages enter +n or -n where n is any number."
sAns = InputBox(a$,"GO TO PAGE " & Info,Def)
If sAns = "" then End
b = split(sAns) : c = b(0) : d = 0
I = Instr("+-",Left(c,1))
If I > 0 then
 PlusMinus = true
 If I = 1 then c = Mid(c,2) 'Another + sign we need to get rid of.
EndIf
If ubound(b) > 0 then d = b(1)
If Not isNumeric(c) Or Not isNumeric(d) then GoToPage() 
c = Cint(c) : d = Cint(d)
If PlusMinus then
  p = CurrentP + c + d
 Else p = c + d
EndIf
If p < 1 then
 MsgBox("There is no page less than 1.",,"Entry Result =  " & p)
 GoToPage()
EndIf
oVC.jumpToPage(p) 'If beyond end, you get the last page.
PriorPjcv = CurrentP
End Sub

- padmavyuha

*edit* some of the above macro is kind of redundant, and can be trimmed down - but the InputBox() width seems to be a fixed item, there's no way to change the width of the box.
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.