Macros/de/Makros für Writer/Download To File/Gehe Zu Seite

    From The Document Foundation Wiki
    < Macros‎ | de

    Diese Makro öffnet eine Eingabzeile, in die die Seitennummer, auf die man gelangen möchte, eingetragen wird.
    Nach OK oder Enter Springt die Ansicht zur eingegebenen Seite


    REM  *****  BASIC  *****
    
    'Copyright (c): Autor unbekannt, übernommen von http://www.oooforum.org/forum/viewtopic.phtml?t=77509
    
    '    This program is distributed in the hope that it will be useful,
    '    but WITHOUT ANY WARRANTY; without even the implied warranty of
    '    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    '    GNU General Public License for more details.
    
    '    Dieses Programm wird in der Hoffnung, dass es nützlich sein wird, aber
    '    OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
    '    Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
    '    Siehe die GNU General Public License für weitere Details.
    
    '------------------------------------------
    
    Sub JumpToPage
    Dim oVC,max,sAns,p
    oVC = ThisComponent.CurrentController.getViewCursor
    oVC.jumpToLastPage
    max = oVC.getPage
    sAns = InputBox("Enter a page number.","Jump to page.")
    If sAns = "" then
      End
     ElseIf Not isNumeric(sAns) then JumpToPage
    EndIf
    p = CInt(sAns)
    If p = 0 Or p > max then
     MsgBox "No such page!"
     JumpToPage
    EndIf
    oVC.jumpToPage(p)
    End Sub