[OOo] 跳頁的巨集–更新
由OOoForum.org看到的巨集:直接跳到某一頁。在自訂裡把這個巨集指派給按鍵Ctrl+G,以達成和Word類似的功能。若不透過這個巨集的話,目前OpenOffice.org Writer必須用助手窗才能跳頁。
Sub JumpToPage 'Goes to home position on page X. Tap Space Bar 'to get the view there. oVC = thisComponent.CurrentController.getViewCursor Do sAns = InputBox("Enter the page below.","JUMP TO PAGE") If sAns = "" then End Loop Until isNumeric(sAns) oVC.jumpToPage(Cint(sAns)) 'If beyond end, you get the last page. End Sub |
2006/05/11 加強版:
Global PriorPjcv as String Sub GoToPage Def = PriorPjcv Def = Lcase(Def) oVC = thisComponent.CurrentController.getViewCursor CurrentP = oVC.getPage If Not ShowDef then Def = "" Info = "目前頁碼= " & CurrentP If PriorPjcv <> "" then Info = Info & " 先前頁碼= " & PriorPjcv a$ = "請輸入頁碼。" & Chr(10) a$ = a$ & "若有目錄等文前部份,附加一個空白和偏移量;" a$ = a$ & "例如:7 14會跳到文前第14頁後的第7頁。" a$ = a$ & "前n頁或後n頁請用 -n 或 +n。" sAns = InputBox(a$,"[移動頁碼] " & 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("頁碼必須由 1 開始。",,"輸入結果 = " & p) GoToPage() EndIf oVC.jumpToPage(p) 'If beyond end, you get the last page. PriorPjcv = CurrentP End Sub |
##
您可能也會有興趣的類似文章
- [OOo] 表格製作的快速鍵巨集 (0則留言, 2006/06/08)
- [OOo] 輸入數值產生Unicode字元的巨集 (0則留言, 2006/05/07)
- [OOo] 換行與鎖定 (0則留言, 2006/04/30)
- [OOo] DOC轉成ODT格式的Script (0則留言, 2006/06/08)
- AndrOpen Office與OpenOffice for Browser提供OpenOffice.org編輯功能 (0則留言, 2013/12/31)
- OpenOffice.org的文字文件突然變成唯讀!? (11則留言, 2008/10/23)
- OpenOffice.org擴充的集中站 (0則留言, 2008/01/31)
- [OOo] 預設格式(Default Formatting)的用途 (0則留言, 2007/09/19)
- 加快OpenOffice執行速度的方法 (0則留言, 2007/08/19)
- [介紹] 必須擁有的OpenOffice.org擴充套件 (0則留言, 2007/05/13)
- [OOo] OpenOffice.org轉檔的方法 (3則留言, 2006/07/18)
- [OOo] 如何在緊鄰上邊界的表格上方能多出一列 (0則留言, 2006/06/17)
- [OOo] Writer衝到新注音/新倉頡輸入法! (0則留言, 2006/06/08)
- [OOo] ODT格式另存成DOC時無法修改段落樣式 (0則留言, 2006/05/28)
- [OOo] 一篇文章裡使用數個編號系統 (0則留言, 2006/05/25)
Sorry, 很久沒用Google sc…