Microsoft Word/relative and absolute links
QUESTION: Hi Aidan!
Thanks for helping out on my questions way back in May.
Working on the same Word 2003 doc with quite a few thousand internal links, about half way through I realized how to make the links by selecting the tab on the left in the hyperlink box to "in this document" rather than select the file(same in this case)in the list of files and then the bookmark.
That means the screentip just shows the bookmark without the whole file path.
If the operating system freezes or I forget to switch the power on at the wall and the battery runs out then MS will create a file to save the changes.
When selecting and saving that file rather than the original the path in the screentip shows an extra word /Application Data/ and so when saving the links don't work any more.
Unless there is something I am doing wrong on saving, I have lost many hours of work many times when the computer cuts out and I have to reboot.
This doesn't happen with the method of selecting the "within document" upon making the hyperlinks.
Is there some way to change all those thousands of links with the file path to links with the screen-tip just showing the bookmark without having to individually edit the hyperlink by scrolling though all those bookmarks?
I did see a posting on a thread by MS MVP Paul Edstein ("macropod") with a VBA to edit the lot but could not find a forum to ask him. He lives in Canberra and the link to the attachment on the thread for the VBA was:
"Also attached is a macro I've created for automatically updating the field paths for INCLUDEPICTURE, INCLUDETEXT, RD, HYPERLINK & LINK fields. To use it, simply extract the file from the zip archive, open up the Word VBE (Alt-F11) and import the file into the document you want to use it with, then save the document. At present, though, the code does not work with linked shape objects (eg Excel worksheet objects formatted as 'square') in the document header or footer.
o AutoFldUpdt.zip (1.8 KB, 650 views)
Is something like that the way to go?
Alternatively, is there some way to save the repaired file that comes up when restarting Word after it has closed unexpectedly without all the links having "Application Data" in the file path, or can they be deleted using find and replace?
I can send the updated file to you if it's any help. I am a computer novice.
I have your email.
Thank you for your time.
I use XP and Word 2003 SP3
ANSWER: The question you found was in a forum (http://windowssecrets.com/forums/showthread.php/102080-Relative-Paths-in-Word-Fi
(All) ) but yes, that would probably be the best solution - certainly I would expect to do it with VBA (although in your case the VBA would be a lot simpler - or could be at any rate - as it is a known set of circumstances that need fixing - so each hyperlink would simply need part of the link taking away.
---------- FOLLOW-UP ----------
QUESTION: Thanks Aidan again!
I got some help to put import the macro into the file.
The dialog comes up incorrect syntax, which from my previous experience with my previous use of just one macro means I incorrectly typed it in.
In the new macro I pasted it in.
Some of the text in the VBA file is in red and blue.
They appear to be information about what each line means, and also how to edit the macro for the end user's particular circumstances.
Do I try to follow those and then delete the red and blue text?
In my novice stage it may appear easier to solve the problem by finding out how to save the repaired file which comes up in the r.h. side box when the computer shuts down suddenly before I can manually save the file so that the extra word "Application Data" doesn't appear.
I actually did do it once but can't remember exactly how I did it.
(Perhaps it had something to do with not working on a copy rather than the original(just recently learned how to create a copy, work on it satisfied the name won't change, and save it elsewhere and then change it back to the same name as the original so that the links will still work. I will try that again when I get a new computer as this one is a friend's.)
All other times either the saving froze and I had to switch off the computer anyway or else it saved with the extra word in the file path.
If I can clarify the exact instructions and write it down (so as not to forget it)that would solve that particular problem for me.
The VBA may be useful for changing absolute to relative links with the 5000 odd links between my other files.
Perhaps I should put them all in a folder (just learned haw to make one of those as well-always forgetting how to do these simple tasks).
Can I do that without changing all the absolute links to relative so that when I post or send them people don't have to extract them all individually to their desktop as that's where I made them?
Sorry to have to bother you as a top professional for these petty questions but I'm often stumped and at my age (58) I can't see spending the time to do courses since my work is only very specific.
Thank you for your continued time and consideration.
I'm almost 52 and still learning - but I haven't done any courses! Saving the repaired file should simply be a case of save as and overwriting the original (or for safety giving it a new but similar name, check it works and then delete the original) - I think it may be easier to see the file - if you can send it I can try and sort things out for you.