Hyperlink issue in Visio 2007

Started by Pradeep Pant, June 16, 2008, 11:27:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pradeep Pant

Hi All,
I am creating hyperlink to a document from a image in Visio 2007 by using INSERT-->Hyperlinks (checking the relative path option). After that I am saving it as web page and publishing it.
The complete web address of the document will be provided later by my code. When I run my code hyperlinks doesn't work. I am unable to understand the issue as the same works fine with Visio 2003. Then I compared the gif_1.htm file of visio 2003 and visio 2007 for the same and found that a extra string "../" has been inserted in HREF section (just before the name of document to be linked) in Visio 2007 created gif_1.htm. If I remove them mannually then everything works fine.

Can anybody help me out to understand the HTML behaviour in Visio 2003 and Visio 2007 and provide and workaround for that.

Thanks in advance

Pradeep

Lars-Erik

Well, normaly in HTML "../" means its looking for the file a level down, so the problem might be with the file your inserting.
Is the file your inserting in the same location as the Visio document or a level down? Also are you keeping it in the same relitive position? I haven't noticed your problem before...

- Lars

scott

I believe you've run into a "behavior change" between Visio 2003 and Visio 2007. Microsoft changed the implied hyperlink base for relative links when publishing web pages. It's a change for the better, IMHO, but a change nonetheless.

In Visio 2003, if you create a relative link to a document, the implied hyperlink base when following the link from within Visio is the folder containing the Visio document. Yet when you save the drawing as a web page, and follow the link from your web browser, the implied hyperlink base is the subfolder containing all of the javascript, html and other files for the web-published drawing -- it is *not* the folder containing the visio drawing and the primary web page but is one level down, i.e., in the subfolder.

For example, in the attached snapshot of a set of files and folders, assume that "Hyperlink examples.vsd" contains a relative hyperlink to "Sample 4.doc". The left side of the snapshot shows the resulting files/folders after saving as web page. When you open the published web page ("hyperlink examples.htm") in your browser, the link to "sample 4.doc" will not work; you must move or copy "sample 4.doc" into the web subfolder, as shown in the right side of the dragram.

In Visio 2007, the code produced by the save as web page function is different. The implied hyperlink base is the same for both the Visio drawing file and for saved web pages -- it is the folder containing the Visio drawing, which by default is also the folder containing the primary html page. Your observation about the contents of gif_1.htm is correct -- the "../" is what pushes the starting point for following links back up one level in the Windows directory hierarchy.

For Visio 2007, you can ignore the right side of the attached file system snapshot. Everything works the way you expect it to with all files in their original locations as shown on the left side of the picture.

Because you have a file/folder structure that works with Visio 2003, you should be able to work around the change in Visio 2007 by moving the target document up one level in the Windows directory structure.

sdtaco

Resurrecting this old post hoping to find a resolution and if other are still having the same problem.

I am having the same issue. We generate Network drawings and have click-able links for the hosts in the network. A bit of code runs in the background that make everything come together.

Ever since my upgrade from 2003 to 2007 the save as a Web Page does not turn out the same results from the previous version to the next. In 2007 when we save as web page all the links have ../

I have tried moving the html file down one level to see if that worked and it didn't.  Was there ever a resolution to this issue?

Basically when you save a document as a web page you get 2 things. #1 a Folder labeled the file name with all the xml,gifs,and htm. #2 a .htm file outside of the folder  labeled as the file name.

So if I were to save test.vsd as a web page to my desktop I would get
test_files
test.htm

Can anyone help with this issue?

scott

You said that you "tried moving the html file down one level to see if that worked and it didn't."

I think you might have gone the wrong way. You don't want to move the html file -- it needs to remain at the same level as the Visio-created subdirectory. To use your examples, test.htm must remain in the same folder as test_files. To avoid changing your existing code (the code that works with Visio 2003) you need to move the documents that are the hyperlink targets up one level in the Windows hierarchy.

Your other alternative is to alter your back end code so it removes "../" from each hyperlink.

BTW, I don't believe there will ever be a fix for this, that is, Visio 2007 will never work the same way that Visio 2003 did. I think the way Visio 2003 created hyperlinks was wrong because it caused Visio links and web links to behave differently. Visio 2007 and Visio 2010 operate correctly in that link behavior is consistent whether you follow the link from a Visio drawing or a web-published version of the drawing.


sheelaa

I am a new member but I was running into the same problem so thought I could post what fix I made.

When creating links in a vsd, and linking to specific pages in the file, we usually select the file (Eg. .vsd) and specify the page number. Then we save the file as a web page.

Linking (Visio) web pages to each other (and to specific pages) worked to a certain extent within the file, but not outside. What worked for me is this.

I linked to the htm page (saved from vsd) instead of linking to the original vsd. This way you cannot specify the page number, but before saving as web page, the linking from various pages can be modified within the pages as suitable. The folder structure also need not be changed.

I hope I was clear in explaining what I did and hope it is useful for any others who encountered this problem.



scott

sheelaa,

Thanks for posting the technique that worked for you. We have recommended this same technique to our customers if they need to include links from one web-published Visio drawing to another web-published Visio drawing. The problem gets slightly more complicated if both web-published drawings have hyperlinks to each other, but it does work.

BTW, you can include page number references in the links to web-published drawings -- the secret is in knowing the required syntax. Visio MVP John Goldsmith published a great article on this subject.

Scott