我使用了以下内容,但它不起作用
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
答案 0 :(得分:4)
使用此方法获取突出显示的文本列表。
Private Function GetListOfHighlightedString(ByVal Docx As WordprocessingDocument) As List(Of String)
Dim lstOfHighlightedString As List(Of String) = New List(Of String)()
Try
For Each EachRun In Docx.MainDocumentPart.Document.Body.Descendants(Of Run)()
If EachRun.RunProperties IsNot Nothing Then
For Each EachPrpChild In EachRun.RunProperties.ChildElements
If TypeOf EachPrpChild Is Highlight Then
Dim highlightVal As Highlight = TryCast(EachPrpChild, Highlight)
If highlightVal.Val.Equals(HighlightColorValues.Yellow) Then
lstOfHighlightedString.Add(EachRun.InnerText)
End If
End If
Next EachPrpChild
End If
Next EachRun
Catch e1 As Exception
Throw
End Try
Return lstOfHighlightedString