It is true, see SDK documentation → “XTextRangeCompare Interface Referencepublished compares the positions of two TextRanges within a Text.”
It is not possible even manually.
Situation is more complicated. Not all objects are searchable with SearchDescriptor (or with UNO command .uno:ExecuteSearch for Find&Replace gotten for example with Macro Recorder).
Sub findAndSelect 'find the occurences with SearchDescriptor
dim oDoc as object, oDesc as object, oFound as object
oDoc=ThisComponent
oDesc=oDoc.createSearchDescriptor
oDesc.SearchString="{"
oFound=oDoc.findAll(oDesc)
if NOT isNull(oFound) then oDoc.CurrentController.Select(oFound)
End Sub
Graphical object included text (like Insert / Text Box, or Insert / Shape/ Basic Shapes / …) is necessary to traverse one by one. It is possible to use TextCursor in these objects via method .createTextCursor (like oDoc.Text.createTextCursor).
Sub useTextCursorInTextbox
dim oDoc as object, oVCur as object, oTextBox as object, oCur as object
oDoc=ThisComponent
oVCur=oDoc.CurrentController.ViewCursor
oTextBox=oDoc.DrawPages(0).getByIndex(0) 'it could be 1st Text Box etc.
oCur=oTextBox.createTextCursor
oCur.collapseToStart
oCur.goRight(1, true) 'select 1st letter in Text Box
End Sub
But it isn’t possible to select the text from these objects with some text from main text of document.
The question could be how to put View Cursor (oDoc.CurrentController.ViewCursor) to these object, because it has other methods than Text Cursor (oDoc.Text.createTextCursor), but unfortunately I don’t know .
And the Headers and Footers are accessible from PageStyles Make selection with ViewCursor for Text in Footer\Header - #5 by KamilLanda