As a tidy up of code from previous questions, for which I have received superb support. In tidying up the code and testing, I find that if a document contains a text box table I get the following error
1:An exception occurred
Type: com.sun.star.lang,IllegalArgumentException
Message: cannot coerce argument type during coreflection call:
arg no.: 0 expected: "com.sun.star.text.XTextRange" actual:
"com.sun.star.text.XTextContent" ./stoc/source/coreflection/
criface.cxx:652
Line: 729"
Without the text box table, code works as intended and line 729 is
oCur=oDoc.Text.createTextCursorByRange(oEnum.nextElement) 'current paragraph as cursor'
Which works within a loop detecting line styles and executes code accordingly, until it hits the text box.
oCur.ParaStyleName which is part of the following code does not seem to show text boxes tables, so what can I use to test for them?
All I need do is test for that text box table and skip the code that follows,
EDIT: I’m an idiot, NOT a Text box but a TABLE!!!