Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Relative Hyperlink Hell

Posted on 2012-03-20
1
Medium Priority
?
1,183 Views
Last Modified: 2012-06-27
I'm generating a word document through Word Automation. All it is is a "table of content" displaying hyperlinks to other documents. These documents will be placed in the same folder as the word document, and all of it is moveable. So the hyperlinks need to be relative.

Well, I reckon I am setting the Hyperlink base correctly:

oWA.ActiveDocument.BuiltInDocumentProperties.Item("Hyperlink base").Value = "."

And the hyperlink then simply refers to a document "DOC0001.doc" (for example).
oWA.ActiveDocument.Hyperlinks.Add(oWA.Selection.Range, "DOC0001.doc", "", "",  "click me!")

(oWA is the Word.Application object)

And if you then open the generated document, sure enough when you move the mouse over where I create the Hyperlink it says "Ctrl+Click to follow link"

But when I click on that it says "The address of this site is not valid. Check the address and try again." When I "Edit hyperlink", there is DOC0001.doc, quite happily sitting in the same folder as the word document. But even if I then PICK THAT from the Browser and I use Word itself to create a hyperlink to that file ... if I then try to Ctrl+Click to follow the link, it STILL says "The address of this site is not valid".

I check through File - Info - Properties - Advanced Properties and I confirm that the Hyperlink Base is set to "."

What's even weirder is that if I go save the document AS PDF, and I then click on the hyperlinks in the generated PDF document THEY WORK! - so that indicates to me that there is, in fact, not actually anything really wrong with the hyperlinks themselves. They have been configured correctly. It's WORD that is getting its panties in a twist.


So how do I get it to behave itself?


In case the tags aren't clear: This is happening in Word 2010. On a Windoze 7 machine, 64 bit. But it's a 32-bit version of Office.


And I have both Windows 7 and Office 2010's Service packs SP1 installed.



[whines feebly] HELP ME *sob*

150 poinks for "sorry but you're screwed, and this is why ...". Will up to 500 for actual solution.
0
Comment
Question by:WernerVonBraun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
WernerVonBraun earned 0 total points
ID: 37743461
Aaaarrrggghhhh. Never mind folks. The Hyperlink Base should be BLANK, not "."

gngngnggngng*pop*

Delete...
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question