![]() |
|
#1
|
|||
|
|||
![]()
I think this would be faster and more comprehensive:
Code:
Sub GetHeadings() Dim oDoc As Document: Set oDoc = ActiveDocument Dim varHeadings As Variant, lngIndex As Long Dim oRng As Word.Range varHeadings = oDoc.GetCrossReferenceItems(wdRefTypeHeading) Set oRng = oDoc.Range For lngIndex = 1 To UBound(varHeadings) With oRng.Find .Text = Trim$(varHeadings(lngIndex)) .Forward = True If .Execute Then If Left(oRng.Paragraphs(1).Range.Style, Len("Heading")) = "Heading" Then MsgBox varHeadings(lngIndex) & " auf Seite:" & oRng.Information(wdActiveEndAdjustedPageNumber), vbOKOnly End If oRng.Collapse wdCollapseEnd End If End With Next lbl_Exit: Exit Sub End Sub |
#2
|
|||
|
|||
![]()
With your comprehensive solution this thread seems to be REALLY solved
![]() Thanks NP |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
dljenks | Word | 1 | 01-03-2014 01:38 PM |
![]() |
wmac | Word | 1 | 05-14-2013 08:54 PM |
Cross Reference Heading Number with the word "Section" included | bblouin | Word | 5 | 12-20-2012 05:27 PM |
![]() |
mpdsal | Word | 1 | 07-26-2012 01:05 PM |
2 figures cross reference | mmdmov | Word | 0 | 05-05-2010 09:12 AM |