![]() |
|
#10
|
||||
|
||||
|
OK, try this code which collapses the range to test whether the bookmarked range starts with hidden formatting.
Code:
Sub useFormInhaltFuellen()
'nach Reihenfolge im Doku sortiert
'ohne Kopf- und Fußzeile
Dim aDoc As Word.Document, aBkmk As Bookmark, v As String
Dim aRng As Range, strArray() As String
Set aDoc = ActiveDocument
If aDoc.Bookmarks.Count = 0 Then
MsgBox "kein Textmarken im Dokument enthalten!"
Exit Sub
End If
For Each aBkmk In aDoc.Bookmarks
Set aRng = aBkmk.Range
aRng.Collapse Direction:=wdCollapseStart
If Not aRng.Font.Hidden Then
v = v & "|" & aBkmk.Name
End If
Next aBkmk
v = Mid(v, 2) 'remove the leading separator
strArray = Split(v, "|")
ufInhalt.ListBox1.List = strArray 'Listbox1 eintragen
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to text heading1 text heading1 text? How to collapse or hide text in the middle of a line. | TImer | Word | 7 | 08-10-2020 12:52 AM |
| Conditionally hide parts of a document | elaineAda | Word VBA | 0 | 04-01-2019 10:00 PM |
How to manage (display/hide) parts of the text within a document via table of content
|
Curby | Word | 2 | 06-30-2016 12:29 AM |
| Page nos in footers - how to hide mid document | willynilly | Word | 2 | 11-22-2013 07:21 AM |
Hide sentances in a word document
|
michaelgott | Word | 1 | 04-19-2012 08:11 PM |