Jonast.
04-08-2023, 03:52 AM
Hello everyone,
the following code is part of a longer macro:
Dim TOFRange As Range
Dim Found As Boolean
Set TOFRange = ActiveDocument.TablesOfFigures(1).Range
With TOFRange.Find
.ClearFormatting
.Font.Italic = True
.Font.Bold = True
.Text = ""
.Forward = True
.Wrap = wdFindStop
Do While .Execute
If Not TOFRange.InRange(ActiveDocument.TablesOfFigures(1) .Range) Then
Exit Do
End If
TOFRange.Font.Italic = False
TOFRange.Font.Bold = True
TOFRange.Collapse wdCollapseEnd
Loop
End With
This part formats a section of my table of figures.
My plan is to have the same functions for tables. Therefore, I have inserted a table of tables, which is also a TOF. Now my question is: How do I change the above code so that Word knows that I mean the table of tables and not the table of figures? I have already replaced the 1 behind TablesOfFigures with all numbers up to 9, but unfortunately this does not change anything.
Thank you and have a nice Easter weekend!
Regards, Jonas
the following code is part of a longer macro:
Dim TOFRange As Range
Dim Found As Boolean
Set TOFRange = ActiveDocument.TablesOfFigures(1).Range
With TOFRange.Find
.ClearFormatting
.Font.Italic = True
.Font.Bold = True
.Text = ""
.Forward = True
.Wrap = wdFindStop
Do While .Execute
If Not TOFRange.InRange(ActiveDocument.TablesOfFigures(1) .Range) Then
Exit Do
End If
TOFRange.Font.Italic = False
TOFRange.Font.Bold = True
TOFRange.Collapse wdCollapseEnd
Loop
End With
This part formats a section of my table of figures.
My plan is to have the same functions for tables. Therefore, I have inserted a table of tables, which is also a TOF. Now my question is: How do I change the above code so that Word knows that I mean the table of tables and not the table of figures? I have already replaced the 1 behind TablesOfFigures with all numbers up to 9, but unfortunately this does not change anything.
Thank you and have a nice Easter weekend!
Regards, Jonas