[Solved+Issue] Automatic update of table of content / index
-
hhue13@gmail.com
- Posts: 4
- Joined: Thu Jun 26, 2014 11:23 am
[Solved+Issue] Automatic update of table of content / index
Is there a way so that OO Writer automatically updates in Index / Table of Contents when the document is printed or exported as PDF? Would ensure that the index is always current when a document is printed / exported as PDF for sharing (and sometimes I only realize that I forgot to do that when it is too last
).
Last edited by Hagar Delest on Fri Jun 27, 2014 11:04 pm, edited 2 times in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OpenOffice 4.0.1 on RHEL
Re: Automatic update of table of content / index
Greetings and welcome to the community forum!
That could be a nice option, but no. There's no built-in way to to that, as far as I know.
That could be a nice option, but no. There's no built-in way to to that, as far as I know.
AOO4/LO5 • Linux • Fedora 23
-
hhue13@gmail.com
- Posts: 4
- Joined: Thu Jun 26, 2014 11:23 am
Re: Automatic update of table of content / index
Thanks for your response on this. Is there a way to submit such request / suggestions regarding enhancements?
OpenOffice 4.0.1 on RHEL
Re: Automatic update of table of content / index
Bugzilla report at
https://issues.apache.org/ooo/show_bug.cgi?id=25710
suggesting automatic update of ToC before printing.
https://issues.apache.org/ooo/show_bug.cgi?id=25710
suggesting automatic update of ToC before printing.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
Re: Automatic update of table of content / index
Thanks for digging out the issue!
Looking at the issue comments, there's a link to this oooforum thread: http://www.oooforum.org/forum/viewtopic.phtml?t=11826
discussing a macro to do the update. You can bind a macro to an event, such as printing or saving, or to a key press--although that's not much different than simply using the built-in menu: Tools > Update > Indexes & Tables.
Since oooforum can be rather difficult to access, here is the macro code from that thread:
I can't say if it works or not.
Looking at the issue comments, there's a link to this oooforum thread: http://www.oooforum.org/forum/viewtopic.phtml?t=11826
discussing a macro to do the update. You can bind a macro to an event, such as printing or saving, or to a key press--although that's not much different than simply using the built-in menu: Tools > Update > Indexes & Tables.
Since oooforum can be rather difficult to access, here is the macro code from that thread:
Code: Select all
sub updater
oIndexes = ThisComponent.getDocumentIndexes()
for i = 0 to oIndexes.getCount() - 1
oIndexes (i).update
msgBox ("Index updated: " + oIndexes.getByIndex (i).getServiceName ())
next i
end subAOO4/LO5 • Linux • Fedora 23
-
hhue13@gmail.com
- Posts: 4
- Joined: Thu Jun 26, 2014 11:23 am
Re: [Issue] Automatic update of table of content / index
Thanks a lot for your help on this ... will give it a try!
OpenOffice 4.0.1 on RHEL
Re: [Issue] Automatic update of table of content / index
A side effect of automatic update of Tables of Content or indexes is that if this is carried out at load or at save time on large documents (typically several hundred pages, ToCed and/or Indexed), it may make the Open/Save Processes even slower than they already are; probably the best compromise is automatic update before printing and perhaps an Update button on the toolbar so the process can easily be manually selected.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
-
hhue13@gmail.com
- Posts: 4
- Joined: Thu Jun 26, 2014 11:23 am
Re: [Issue] Automatic update of table of content / index
Well - I've tested the macro approach and it seems to work nicely. I've modified the code slightly to check the document type as I want to do that only for Writer documents and removed the msgBox (as I personally find that annoying after a while).
The current macro is:
and then I've assigned the macro to the following events (Tools --> Customize --> Events tab.):
This seems to work pretty well ... thanks for your help on this.
The current macro is:
Code: Select all
sub updateIndex
if ((ThisComponent.supportsService("com.sun.star.text.TextDocument")) OR (ThisComponent.supportsService("com.sun.star.text.WebDocument"))) Then
oIndexes = ThisComponent.getDocumentIndexes()
for i = 0 to oIndexes.getCount() - 1
oIndexes (i).update
REM If you want to get a message box when the index is updated
REM remove the "REM" in front of the msgBox line below!!
REM msgBox ("Index updated: " + oIndexes.getByIndex (i).getServiceName ())
next i
end if
end sub
- Print Document
Storing or exporting copy of doc
This seems to work pretty well ... thanks for your help on this.
OpenOffice 4.0.1 on RHEL