Actually, there is a way. However, what exactly you want to do with the italic words/expressions?
From Andrew Pitonyak’s book, you can find some answers.
.
–Little Example–
REM -----------------------------------------------------------------------------
Sub FindItalicExpressionsAndDoSomething(Optional pTextDoc as Object, pWord as String, pWholeWord as Boolean) as Variant
''' Parameters: Text Document, a Word, Whole Word ?
''' Example:
''' Sub Main()
''' oDoc = ThisComponent
''' Call FindItalicExpressionsAndDoSomething ( oDoc, "THE WORD YOU NEED TO FIND", True )
''' End Sub
Dim oSearchDesc as Object
Dim wordsFound as Object
Dim SearchAttributes(0) as New com.sun.star.beans.PropertyValue
If isMissing(pTextDoc) then pTextDoc = ThisComponent
oSearchDesc = pTextDoc.createSearchDescriptor()
REM Descriptor properties
With oSearchDesc
.SearchStyles = True
.searchCaseSensitive = False
.SearchRegularExpression = True
.SearchString = pWord
.searchWords = pWholeWord
End with
REM The attributes to find
SearchAttributes(0).Name = "CharPosture"
SearchAttributes(0).Value =com.sun.star.awt.FontSlant.ITALIC
REM Set de attributes to the Search Descriptor
oSearchDesc.SetSearchAttributes( SearchAttributes() )
wordsFound = pTextDoc.findFirst( oSearchDesc )
REM Here you need to define whatever you want to do.
REM For example, get the word and change the CharWeight to normal
REM However, if you need to replace the words for something else, you'll need to use the ReplaceDescriptor
Do While Not IsNull( wordsFound )
wordsFound.CharWeight = com.sun.star.awt.FontWeight.NORMAL
wordsFound = pTextDoc.findNext( wordsFound.End, oSearchDesc)
Loop
End Sub