Function
BereinigeText(text
As
String
)
As
String
Dim
cleanText
As
String
cleanText = text
cleanText = Replace(cleanText, vbCr,
""
)
cleanText = Replace(cleanText, vbCrLf,
""
)
cleanText = Replace(cleanText, vbLf,
""
)
cleanText = Replace(cleanText, vbTab,
""
)
cleanText = Replace(cleanText, Chr(7),
""
)
cleanText = Replace(cleanText, Chr(11),
""
)
cleanText = Replace(cleanText, Chr(160),
" "
)
cleanText = Replace(cleanText, Chr(13),
""
)
cleanText = Replace(cleanText, ChrW(&H200B),
""
)
BereinigeText = Trim(cleanText)
End
Function
Sub
LeseNummerierteListeBereinigt2()
Dim
tbl
As
Table
Dim
zelle
As
Cell
Dim
absatz
As
Paragraph
Dim
textMitNummer
As
String
Dim
bereinigt
As
String
Set
tbl = ActiveDocument.Tables(1)
Set
zelle = tbl.Cell(3, 2)
For
Each
absatz
In
zelle.Range.Paragraphs
With
absatz.Range
bereinigt = BereinigeText(.text)
If
Len(bereinigt) > 0
Then
If
.ListFormat.ListType <> wdListNoNumbering
Then
textMitNummer = textMitNummer &
"|"
& .ListFormat.ListString &
" "
& bereinigt
End
If
End
If
End
With
Next
absatz
If
Len(textMitNummer) > 0
Then
MsgBox Replace(textMitNummer,
"|"
, vbLf)
End
Sub