Change path´s to external files in Hyperlinks (user modules)

Discussion on theWord modules and other resources
fraka
Posts: 23
Joined: Fri Jun 06, 2008 12:11 am
Location: Germany

Change path´s to external files in Hyperlinks (user modules)

Post by fraka »

Hello,

I have created some big user modules with hundreds of hyperlinks to external files (PDF´, JPG´s, etc).
Now I had to change the storage location/directory of the external files and changed the location where I stored TW.
Result: All hyperlinks to external files in my modules are broken (not very suprising...)
So I have to change all pathnames within the hyperlinks to the new storage location.
To solve this problem I could change all hyperlinks manually (but for hundreds of hyperlinks???)

Is there a possibility to change the pathnames within the hyperlinks automatically? Or maybe via search and replace?

Any help appreciated.

Thank in advance
Frank
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Re: Change path´s to external files in Hyperlinks (user modu

Post by csterg »

Hello Frank,
yes there is, but backup your mod first.
You need to convert your module content to RTF first (from Module Properties dialog, Actions) and then use the Importer Tool to do a 'Reg Ex search and replace' to the actual rtf codes. This is not as hard as it looks. If you are not sure about the actual search and replace post here the rtf content of a very small topic with a link and i will help.
If all this seems too complex then we ll take another way to help.
By the way: i suggest that you use relative parts for the external files and not absolute ones, so you can move the .twm file along with the external files with no problem.
Costas
fraka
Posts: 23
Joined: Fri Jun 06, 2008 12:11 am
Location: Germany

Re: Change path´s to external files in Hyperlinks (user modu

Post by fraka »

Dear Costas,
many thanks for your quick reply!
I will try it within the next one or two weeks. I think, it would be helpful to have a link to the search an replace functions of the importer.
Or is it possible to use a textprocessor like LibreOffice Writer to do this job?
And I`m missing the way back into the mod, after changing the text (hyperlinks). Also via importer or via mod options?

My pathnames in the hyperlinks are absolute as shown below:
K:\theword\... (all files and directories of TW in compact mode)
K:\theword\Artikel verlinkt\.... (all external files are stored in this path and his subdirectories within the TW directory)

So I changed TW from K:\theword\... (a network path)
to c:\theword\... (local HDD)
and i changed the subdirectories pathnames within C:\theword\Artikel verlinkt\... into a better system and order.
What do you mean with relativ path´s?
Many thanks for your Work and your help!
In Jesus Christ
Frank
fraka
Posts: 23
Joined: Fri Jun 06, 2008 12:11 am
Location: Germany

Re: Change path´s to external files in Hyperlinks (user modu

Post by fraka »

Dear Costas,
after some work, I need some more help (sorry...)
- I converted a book to rtf format.
- downloaded the newest importer tool und run it
- opened the "utils" tab
- browsed to the relevant file
- tried to perform an regex search and replace - and failed terrific!
I had no sample text or sample result.
I got the message: "Done. Total 326 entries, fixed: 325, ignored (non-rtf): 1"
But nothing ist changed, all hyperlinks are still the same.

The problem ist how to find the correct phrase for the search, I think the rest will be easy.
The paths for hyperlinks were at the moment:
K:\The Word-Gitta\...
I will change all hyperlinks to
J:\The Word-Gitta\...
So I wrote in the "Find"-field: K:\The
an in the replace field : J:\The
surely to naive.
I looked in a manual of regex expression wich I found at the forum, but it´s to complicated for me :(
Can you help me with a proper phrase?
Thanks
Frank
User avatar
JG
Posts: 4604
Joined: Wed Jun 04, 2008 8:34 pm

Re: Change path´s to external files in Hyperlinks (user modu

Post by JG »

Try this on a copy of the module using the util.

search: K:\\The
Replace: J:\The
Jon
the
Word 6 Bible Software
OS for testing; Windows 10
Beta Download ------Beta Setup Guide------On-line Manual------Tech doc's and Utilities------Copyright Factsheet
fraka
Posts: 23
Joined: Fri Jun 06, 2008 12:11 am
Location: Germany

Re: Change path´s to external files in Hyperlinks (user modu

Post by fraka »

Dear JG

Thank you for the tip.
But -I´m sorry - it´s without success. Same result as i had, nothing´s changed :(
Any other help?
Thanks
Frank
User avatar
JG
Posts: 4604
Joined: Wed Jun 04, 2008 8:34 pm

Re: Change path´s to external files in Hyperlinks (user modu

Post by JG »

Can you post the file here, or perhaps copy one of the topics to a new module and post here.
Jon
the
Word 6 Bible Software
OS for testing; Windows 10
Beta Download ------Beta Setup Guide------On-line Manual------Tech doc's and Utilities------Copyright Factsheet
fraka
Posts: 23
Joined: Fri Jun 06, 2008 12:11 am
Location: Germany

Re: Change path´s to external files in Hyperlinks (user modu

Post by fraka »

Dear Jon,

thank you. If it´s not public, i will post the file for you, but be aware it´s in german. I hope that´s no problem.
Pls tell me if it´s pulic or not, then i will send you the file (ca. 2,7 Mb)
Greetings
Frank
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Re: Change path´s to external files in Hyperlinks (user modu

Post by csterg »

Hi Frank,
pls use email, do not post the file here.
Costas
fraka
Posts: 23
Joined: Fri Jun 06, 2008 12:11 am
Location: Germany

Re: Change path´s to external files in Hyperlinks (user modu

Post by fraka »

Ok, thats the best.
I will send the file immediatly to: help at theword dot net
Frank
Post Reply