Friday, October 29, 2010

LibreOffice / OpenOffice and repeating without 'cut paste'

Working on a recent document that involved some figures had me wondering how to have the same figures repeated.

I have used the Free Open Source Office Suite for 7 years, and wondered how to get the result without using 'Cut and Paste'

The particular section I will be repeating, is unusual in that it includes many numeric results, but not enough to really justify living in a separate spreadsheet.

Conceptually here is what I want:


One way to achieve this is to use Sections and the Navigator
( My icon looks more like a four pointed star. Compass or Star will do and hovering should say 'Navigator' )

Page2 in that concept diagram I show the repeated text in grey, as it is important that it is non-editable
( Just too easy otherwise to fall in and edit things in the wrong place! )


I list the steps involved and then run through with some screenshots:

  1. Insert -> Section          and give the section a name say 'Section1'
  2. Open Navigator and Right Click on 'Sections' to get a drop down menu
  3. From that drop down menu select 'Drag Mode' then 'Insert as Link'
  4. In your document move to where you want the copied section to go, and then drag 'Section1' from the Navigator into place.
  5. Right click the new entry in 'Sections' within Navigator and select 'Rename'. Make name Section1copy 
  6. Right click the new entry in 'Sections' and select 'Edit' and understand what the padlock symbols say


1. Insert -> Section

2 & 3 in Navigator:

6 ... padlock symbols:

If all went well then you should see something like the above. Section1 is unlocked (editable), whereas Section1copy is locked and will show as 'read-only' in the bottom status bar.


The quicker way of achieving the same result:

Having already created a section and populated it with the text which you will be repeating, just do Insert -> Section and check the 'link' checkbox.

It is not necessary to use the Navigator at all. However once you begin repeating sections and including links in your documents, then it is probably worth knowing your way around the Navigator feature.


The ultra fast way of achieving a similar result (Paste Special):

Copy and Paste but keep your finger on Shift when you Paste.

Select 'DDE link' from the 'Paste special' menu that pops up.


In order for the DDE link to work, a new Bookmark will have already been created in Navigator like so:


This type of link is marked 'soffice' internally and has details that look similar to the following example:


The advantage of using this 'Paste Special' DDE link way is speed obviously, and you do not have to create a Section around your text in preparation.

Where using Sections wins out is in complex documents, where perhaps you have repeated different blocks of text. Having the Sections clearly identified in Navigator can be a real win for that complex case.


Avoiding the startup 'Update all links' prompt:

Having setup a document with a repeated Section as described, you may then see this on opening your document:

And switching that off can be achieved in Tools -> Options -> Writer -> General


so that 'Update links when loading' is set to 'Always'


Deleting Sections and clearing up:

Use the Navigator and right click 'Edit' the section you want to remove.

Within 'Edit' you have a 'Remove' button which will do the trick.

Clearing up:
The text block I was copying was prepared as a table by me.

What I noticed was that removing the section did not delete the text copy itself, but merely reverted it to being 'standalone' typical text. A handy feature perhaps but do manually delete the text if that is not what you wish to be left with.


Links and further reading: