![]() |
|
#1
|
|||
|
|||
![]() Code:
Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey Dim arrHeadings() As String Dim lngIndex As Long, lngHeading As Long For lngIndex = 1 To ActiveDocument.Paragraphs.Count If Left(ActiveDocument.Paragraphs(lngIndex).Range.Style, Len("Heading")) = "Heading" Then ReDim Preserve arrHeadings(1, lngHeading) arrHeadings(0, lngHeading) = ActiveDocument.Paragraphs(lngIndex).Range.Text arrHeadings(1, lngHeading) = ActiveDocument.Paragraphs(lngIndex).Range.Information(wdActiveEndPageNumber) lngHeading = lngHeading + 1 End If Next With UserForm1 .listHeadings.Column = arrHeadings .listHeadings.ColumnCount = 2 .listHeadings.ColumnWidths = "100;20" .Show End With End Sub |
#2
|
|||
|
|||
![]()
Hi,
Thanks for your answer. Meanwhile I also tried: Code:
Sub GetCrossReferences() Dim oDoc As Document: Set oDoc = ActiveDocument Dim myRefs As Variant, i As Long myRefs = oDoc.GetCrossReferenceItems(wdRefTypeHeading) For I = 1 To UBound(myRefs) With Selection.Find .Text = Trim$(myRefs(i)) .Forward = True End With Selection.Find.Execute MsgBox myRefs(i) & " auf Seite:" & Selection.Information(wdActiveEndPageNumber), vbOKOnly Next End Sub 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 |