Avoid to be asked for update "external" links [solved]

I have actually, in a odt file, internal DDE links (from one part to another one of the same file), but when I open that file I am always asked for “update external links”, because that links are seen (in edit → links) as external (with the complete path of that file).
How can avoid this annoying behaviour?

  • Useless “cut” the path of the file (in Edit → Links), leaving only the file name: doesn’t works, the link is not recognized anymore.
  • Useless also Tools → Options → LibreWriter → General > Update lins when loading: always

Thank you!


I’ve found this, but it doesn’t work in Writer, even so modified

Sub  autoupdate_DDE
' 20170314
' load library with help function
GlobalScope.BasicLibraries.LoadLibrary( "Tools" )
' get all DDE links of document '
dde_links = ThisComponent.textfields
' get array of names '
aEN = dde_links.getElementNames()
' work on every DDE link '
for i = 0 to UBound( aEN() )
   xTF = dde_links.getByName( aEN( i ) )
End Sub


As I said I use DDE link (copy a sentence, f.e., and paste special → as DDE link in another part of the same file) to avoid duplicate in the same file
and to duplicate (possible) modifications of the same item.

Please edit your question (don’t use an answer) to explain how you created your links (which menu, which dialog option) as there is no DDE link in LO parlance. Describe your intent (quick navigation to the location of the link or cross-reference). Don’t forget to mention your OS.

My subjective feeling: you may have alternate, more robust ways, of doing this, but I need to know your purpose.

From experiment, the solution would be to bookmark the phrase or paragraph then insert a cross-reference to it. However, the cross-reference can contain only a paragraph worth of data. If your duplicated text extends on several paragraphs, you must cross-reference each paragraph separately.

With cross-references, you have no dialog asking to refresh the links. You are free to refresh them any time you like with Tools>Update>Update All.

If that answers your problem, I’ll transform my comment into an answer and give more details.

With a cross-reference it seems that I cannot I see the sentence (which is in another part of the file). In other words, it is more similar to a hardlink (no good) than to a symlink (good). So this won’t be the solution I’m looking for.
But I’m afraid that this is a LibreOffice bug

What do you mean “I can’t see the sentence”? You access the bookmarks through Insert>Cross-reference and you get the text choosing Reference instead of the usual Page or Chapter.

If you mean you can’t check bookmark content while inserting, yes, this is a shortcoming, while it is possible for headings or numbered paragraphs.

Ok, it seems work quite well, thank you. Just only a problem, so far: format (no bold, no italic), but this was a problem also with dde links. Just some other experiments, afterwards I will mark as solved and your answer as the right one.
Yes, you can transform your comment into an answer: it solved my problem! Thank you!

Internal “links” used to duplicate document paragraphs are much more efficiently implemented with cross-references. However they are limited to only a paragraph worth of text. If the duplicated range spans more than one paragraph, several cross-references must be used, each covering a single paragraph.

The procedure is:

  1. Define a bookmark on the range to be duplicated (Insert>Bookmark and give it a relevant name)

Here, the bookmark can’t be a mere location. It is used to capture text and therefore the text must be selected first. The selection content will be associated with the bookmark.

If the cursor is simply put inside a paragraph, selection range is empty and captured text will contain no character.

  1. Wherever you want the bookmarked text to appear, Insert>Cross-reference, type Bookmarks, insert reference to Reference

Of course, if you want also the page number or the chapter reference, you can insert multiple times the same bookmarks varying the reference to Page or Chapter.

A shortcoming of LO Writer is you can’t check the “content” of the bookmark in the insertion dialog.

Important: the reference is inserted “as a whole” and any formatting (done with character styles) is stripped off before the insertion. Thus you only get raw text then formatted according to the paragraph style at the point of insertion. This is a common limitation in fields (the underlying engine) to avoid queer behaviour and ugly layout if formatting attributes were transferred as is (think for example of font size). You can’t apply character styles or direct formatting on selected words in the insertion.

With cross-references, there is no question about refreshing the links when the document is opened.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

But I use another way: without bookmarks.

  • Select the text you want
  • Insert cross reference → set reference
  • go in the place you want
  • Insert cross reference → insert reference [choose what you want] → reference

This way the text “referenced”, «the content» will be shown where you want.
I avoid at the moment to transform this comment in answer, because of your help, ajlittoz, but you can try my solution.

Very good indeed! One is always blinded by his own needs (mine is page # and chapter # in addition to reference, therefore the cross-reference) and does not see the obvious.

Don’t hesitate to make your comment an answer and I’ll upvote it.

Thanks to ajlittoz I discovered this way. Depending on your needs, this modality could be useful: without bookmarks.

  • Select the text you want
  • Insert cross reference → set reference
  • go in the place you want
  • Insert cross reference → insert reference [choose what you want] → reference

This way the text “referenced”, «the content», will be shown where you want, as a ddl link.

image description

You can also see this video:

I may have missed something: in the Insert>Cross-reference dialog, I don’t see the content of the reference, I only see its name. Have you some procedural trick to make the content visible so that you can check this is the reference you want before the insertion?

Did you selected the content first of all? And did you insert, as reference, “reference” (as in image I have just added above)?

I confirm I only see the reference name, not its content.

After careful study, I think bookmarks and references are strictly equivalent. The only difference is the definition: bookmarks are defined with Insert>Bookmark while references are defined with Insert>Cross-reference, Set reference type. Of course, they are listed in two independent categories.

How can I attach a mkv file?

Cheat: change the extension to .jpeg ot .txt or .odt, but add a caveat in the question (you can only attach files to questions or answers, not to comments). What is a .mkv file? Attachments are limited in size but I don’t know the exact limit.

It’s a kind of video, very useful (it can embed subtitles and chapters, as a DVD) :). I linked a mkv from Google drive, bu I can see it only with Chrome, not with Firefox…

Works for me with Firefox (Fedora Linux, KDE desktop, but no sound track). Shows exactly the same as what I experimented. You have access to the reference name not to its content.

BTW, you should View>Formatting Marks, so that you can discriminate vertical white space from empty paragraphs. Also styles are your friends: never use Default Style for actual text. The “standard” style for text is Text Body.

What is important for me, is have access to content in the normal view of the odt file, not in the dialog window. But in the end, it is clear that everybody has different needs :slight_smile:
Thank you!

A cross-reference is internally managed as a field. You can either display field names (View>Field Names checked) or field content (View>Field Namesun checked).