I have this code, which writes out in msgbox all the paragraphs in the text we put in writer, one after another:
Sub k oParEnum = ThisComponent.getText.createEnumeration Do While oParEnum.hasMoreElements() oPar = oParEnum.nextElement() print oPar.getString Loop End Sub
Please, I am trying to put each paragraph into ints own line
SO THAT I PUT AECH PARTICULAR PARAGRAPH TO A PARTICULARY NAMED STRING.
It means, if text in writer had 3 paragraphs,
I would put first paragraph to string a1
second paragraph to string a2
and third paragraph to string a3
I am trying hardy to understand the syntax, cause I am meeting this for the first time and that is the first example of this I ever did.
Please, if anyone can help with any advice, I would appreciate!
global x as integer global a(x) as string Sub k x=0 oParEnum = ThisComponent.getText.createEnumeration Do While oParEnum.hasMoreElements() oPar = oParEnum.nextElement() x=x+1 a(x)=oPar print oPar.getString Loop End Sub Sub k2 msgbox(a3) End Sub