由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] 輸入數值產生Unicode字元的巨集 (0則留言, 2006/05/07)
- [OOo] 自行製行符號工具列 (0則留言, 2006/04/01)
- [OOo] 表格製作的快速鍵巨集 (0則留言, 2006/06/08)
- [OOo] 移動游標位置的各種的方法 (0則留言, 2005/08/05)
- [OOo] 換行與鎖定 (0則留言, 2006/04/30)
- [OOo] Writer衝到新注音/新倉頡輸入法! (0則留言, 2006/06/08)
- [OOo] 中文拚點包的安裝步驟 (0則留言, 2006/03/28)
- [OOo] Writer的狀態列說明 (0則留言, 2005/07/31)
- [OOo] 自動圖文集與自動校正 (0則留言, 2005/07/30)
- [OOo] 插入目錄的操作-補充 (1則留言, 2006/05/15)
- [OOo] 表格要點備忘 (0則留言, 2006/05/06)
- [OOo] 以左鈕雙擊快速開啟功能視窗 (0則留言, 2005/08/02)
- [OOo] OpenOffice.org轉檔的方法 (3則留言, 2006/07/18)
- [OOo] 如何在緊鄰上邊界的表格上方能多出一列 (0則留言, 2006/06/17)
- [介紹] 必須擁有的OpenOffice.org擴充套件 (0則留言, 2007/05/13)














