R
Rick Gutzmer
As part of a large data mining effort, I am iterating through many word
documents, paragraph by paragraph, and processing each paragraph. Much to
my surprise and pleasure, all the table cells turn out to be paragraphs, and
part of the ActiveDocument.Paragraphs collection. My challenge is - how do
I know if a particular paragraph is part of a list, or inside a table cell?
Below is the psuedo-code for what I want to do.
Public Sub walkParas()
Dim parTemp As Word.Paragraph
For Each parTemp In ActiveDocument.Paragraphs
If isTableCell(parTemp) then
' process contents of table cells here
ElseIf isListItem(parTemp) then
' process list items here
Else
' process normal, in-line paras here
End If
End If
Set parTemp = Nothing
End Sub
Public Function isTableCell(parTest as Word.Paragraph) as Boolean
' here is my problem - how can I test for this?
isTableCell = False
End Function
Public Function isListItem(parTest as Word.Paragraph) as Boolean
' here is my problem - how can I test for this?
isListItem = False
End Function
documents, paragraph by paragraph, and processing each paragraph. Much to
my surprise and pleasure, all the table cells turn out to be paragraphs, and
part of the ActiveDocument.Paragraphs collection. My challenge is - how do
I know if a particular paragraph is part of a list, or inside a table cell?
Below is the psuedo-code for what I want to do.
Public Sub walkParas()
Dim parTemp As Word.Paragraph
For Each parTemp In ActiveDocument.Paragraphs
If isTableCell(parTemp) then
' process contents of table cells here
ElseIf isListItem(parTemp) then
' process list items here
Else
' process normal, in-line paras here
End If
End If
Set parTemp = Nothing
End Sub
Public Function isTableCell(parTest as Word.Paragraph) as Boolean
' here is my problem - how can I test for this?
isTableCell = False
End Function
Public Function isListItem(parTest as Word.Paragraph) as Boolean
' here is my problem - how can I test for this?
isListItem = False
End Function