I have a problem that I am not capable to solve. I have got in Writer document many hyperlinks addresses attached to different words and these addresses I need to change eg:
word 'see' with the link https//subdomain1.domain.com/1 and I need to change it to https://subdomain2.domain.com/1
word 'check' with the link https//subdomain1.domain.com/2 and I need to change it to https://subdomain2.domain.com/2
word 'instead' with the link https//subdomain1.domain.com/3 and I need to change it to https://subdomain2.domain.com/3
word 'information' with the link https//subdomain1.domain.com/4 and I need to change it to https://subdomain2.domain.com/4
.
.
.
and so on.
It I can't do that manually (by right clicking and editing hyperlinks) as there will be many documents and each has hundreds of links. So I think it can be done only with macros. Unfortunately my knowledge in this field almost equal to zero. I would be really grateful for help.
How to change hyperlinks
How to change hyperlinks
LibreOffice ver: 4.2.8.2
Re: How to change hyperlinks
I suggest you give up writing macros and use the properties of the odt document.
It is a compressed set of files that make up the final document.
Do it on a copy.
First, we change the file name from name.odt to name.zip
Extract the content.xml file from this file
Open this file with Writer.
The links correspond to the following structure:
Perform the Find and Replace operation:
Find: href = "https://subdomain1.
Replace: href = "https://subdomain2.
Replace All
Save a file
Copy the file to the name.zip archive
Restore name.odt
That's all
It is a compressed set of files that make up the final document.
Do it on a copy.
First, we change the file name from name.odt to name.zip
Extract the content.xml file from this file
Open this file with Writer.
The links correspond to the following structure:
Kod: Zaznacz cały
<text:a xlink:type="simple" xlink:href="https//subdomain1.domain.com/1 " text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link">word</text:a>
Find: href = "https://subdomain1.
Replace: href = "https://subdomain2.
Replace All
Save a file
Copy the file to the name.zip archive
Restore name.odt
That's all
AOO 4.1.15, LO 7.5.9 (x64) na Windows 10 64bit
Ważne!
Jeśli twój problem został rozwiązany, wróć do swojego pierwszego postu, przejdź do edycji i dopisz [SOLVED] w temacie.
Inni, którzy mają podobny problem, będą wiedzieli, że istnieje jego rozwiązanie.
Ważne!
Jeśli twój problem został rozwiązany, wróć do swojego pierwszego postu, przejdź do edycji i dopisz [SOLVED] w temacie.
Inni, którzy mają podobny problem, będą wiedzieli, że istnieje jego rozwiązanie.
Re: How to change hyperlinks
This is the ingenious solution I dreamed of No macros )
Just wonderful! Additionally I have learned thanks to you that odt file is a kind of compilation of other files. Had no idea about that.
Thank you very much.
Just wonderful! Additionally I have learned thanks to you that odt file is a kind of compilation of other files. Had no idea about that.
Thank you very much.
LibreOffice ver: 4.2.8.2