| View previous topic :: View next topic |
| Author |
Message |
lknoll General User

Joined: 19 Oct 2011 Posts: 32 Location: Harrisburg, Pa
|
Posted: Fri Mar 09, 2012 12:43 pm Post subject: [SOLVED] How can I re-index TextFrames? |
|
|
is there a way to re-index text frames in a writer document?
for example, i start with 2 text frames in this order:
Frame 1
Frame 2
i insert a new text frame in between these frames, so it now the order looks like this:
Frame 1
Frame 3
Frame 2
when i view ThisComponent.TextFrames.ElementNames, i see this:
index 0 = Frame 1
index 1 = Frame 2
index 2 = Frame 3
if i close the document and re-open it, openoffice will re-index the frames correctly to look like this:
index 0 = Frame 1
index 1 = Frame 3
index 2 = Frame 2
is there anyway i can programmatically re-index the frames without closing the document?
Last edited by lknoll on Thu May 10, 2012 6:55 am; edited 1 time in total |
|
| Back to top |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Sat Mar 10, 2012 12:33 am Post subject: |
|
|
Hi,
Don't use index to get a particular text frame. You should name each frame and get them with getByName() method. You can change the name of a text frame with its setName() method. _________________ Bernard
OpenOffice.org 1.1.5 fr / OpenOffice.org 3.4.1 en-US + langpacks, MS-Windows XP Home SP3
This forum is unusable, use instead Apache OpenOffice forums |
|
| Back to top |
|
 |
lknoll General User

Joined: 19 Oct 2011 Posts: 32 Location: Harrisburg, Pa
|
Posted: Thu May 10, 2012 6:37 am Post subject: solved |
|
|
| This worked out great. Thanks for the help. |
|
| Back to top |
|
 |
|