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!

EDIT

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

Sub  autoupdate_DDE
' 20170314
' load library with help function
' get all DDE links of document '
' get array of names '
' work on every DDE link '
for i = 0 to UBound( aEN() )
xTF = dde_links.getByName( aEN( i ) )
xTF.refresh()
Next
End Sub


EDIT

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.

edit retag close merge delete

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

( 2019-06-15 12:16:13 +0100 )edit

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.

( 2019-06-15 14:25:39 +0100 )edit

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...

( 2019-06-15 16:35:55 +0100 )edit

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.

( 2019-06-15 17:19:46 +0100 )edit

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. EDIT Yes, you can transform your comment into an answer: it solved my problem! Thank you!

( 2019-06-15 18:46:10 +0100 )edit

Sort by » oldest newest most voted

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.

You can also see this video:

more

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?

( 2019-06-16 14:20:27 +0100 )edit

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

( 2019-06-17 11:42:12 +0100 )edit

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.

( 2019-06-17 14:30:42 +0100 )edit

How can I attach a mkv file?

( 2019-06-19 17:25:26 +0100 )edit

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.

( 2019-06-19 17:33:02 +0100 )edit

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...

( 2019-06-19 18:03:36 +0100 )edit

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.

( 2019-06-19 18:52:49 +0100 )edit

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 :)
Thank you!

( 2019-06-20 09:37:41 +0100 )edit

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).

( 2019-06-20 10:34:29 +0100 )edit

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.

2. 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!

more

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.

( 2019-06-16 12:43:30 +0100 )edit

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.

( 2019-06-16 13:14:27 +0100 )edit