Announcement

Collapse
No announcement yet.

[KnowHow] Gehe zu "meiner" Überschrift

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [KnowHow] Gehe zu "meiner" Überschrift

    Hallo allerseits,

    Da ich in Word häufig zur Überschrift des aktuellen Bereiches springen muß,
    (und dafür leider keinen Befehl finden konnte - mag ja Blindheit sein ;-)
    habe ich mir mal ein Makro geschrieben, daß meinen Bedarf abdeckt :

    Code:
    Sub GotoMyCaption()
    
        Dim vPg1 As Word.Paragraph
        Dim vPg2 As Word.Paragraph
        Dim vIn1 As Integer
        
        Set vPg1 = Nothing
        
        On Error Resume Next
        Set vPg1 = Selection.Paragraphs(1)
        On Error GoTo 0
        
        If vPg1 Is Nothing Then
           Exit Sub
        End If
        vIn1 = vPg1.OutlineLevel
        Set vPg2 = vPg1.Previous
        
        While Not (vPg2 Is Nothing)
              If vPg2.OutlineLevel < vIn1 Then
                 vPg2.Range.Select
                 Set vPg2 = Nothing
              Else
                 Set vPg2 = vPg2.Previous
              End If
        Wend
        
    End Sub
    Mit einer entsprechenden Schaltfläche spart mir das Makro sehr viel
    "Maus-RadRoll-Zeit" ;-)

    Grüße,
    tAgedObject
    darkness is a state of mind

  • #2
    Hallo tAgedObject

    hier gleich mal ein Feedback von Word 2000
    Klappt prima !!

    Gruß Che

    Comment

    Working...
    X