Apache OpenOffice (AOO) Bugzilla – Issue 26957
error opening hyperlink to bookmark in ms word document
Last modified: 2017-05-20 10:55:46 UTC
This issue is for reopen issue 26425. The defect is this Hyperlink with bookmark dont link to the bookmark in the hyperlinked file the problem is not open the file the problem is open the file and go to the bookmark into the file MSOffice winword hyperlink open the file and then put the cursor at the bookmark into the bookmarked opened file. OOO don't open the file an so it's very far to put the cursor on the bookmark If don't resolve this a lot of documents with hyperlink wroted in MSOffice winword document cannot be linked by OOo. Many people has a history with msoffice, with a lot of work and time dedicated to him. Is not a good idea delete the bookmark. Image if you have a hyperlink to a 1500 pages file and you need see (example) "chapter 2.2" . I hope the answer is not like open file and then use find to locate the word "chapter 2.2" thanks and regards Giorgio Demontis
Created attachment 14077 [details] more
hyperlink with hash-mark from a html file open the hyperlinked file
when i edit a html document i cant open the bookmarked file After save i can open the bookmarked file but curson don't go to the bookmark
please try to use better summary. I did not understand this issue. and I suggest you try OOO 1.1.1.
Created attachment 14291 [details] zipped file with explicative document
Created attachment 14292 [details] basic problem
Reproducible with OOo1.1.1 on W2k Duplicate of issue 26425, everything has been explained there. The hyperlink dialog in OOo Writer allows creation of a hyperlink to a bookmark inside a word document like "sample.doc#par02" But OOo fails to open the link target and displays an error box. Suggesting new summary "error opening hyperlink to bookmark in msword document"
works fine here on Solaris and RedHat Linux 9.0 using OOo1.1.1 and your Test2.zip file and the test1.zip file (Apr 2)...
confirm and change summary
There's an error message from the system, that the file cannot be found, when the hyperlink contains a "#BookmarkName" at the end.
TM->ES: Reproducible when using Windows. Links frome one to another Document are not Framework !
ES->AMA: Reproducible on Windows only
Change OS due to "Additional comments from tm Thu May 13 00:31:29 -0800 2004" and others. I checked with "2.0.1 RC2 German version WIN XP: [680m143(Build8986)]" and found out that it's still impossible to create a working hyperlink to bookmark in a WORD document. It's no problem to create a working hyperlink to a separate WORD document or to a bookmark in a separate OOo document. But strange, if I add the bookmark information _for_a_WORD_document_ in the hyperlink dialogue, that hyperlink won't work any longer, when I try, I get a (WINDOWS-(?)) error message "... can not be found ..." I believe that this is a serious migration obstacle, so I change Priority from 4 to 3. This i not a WRITER issue, same problem for hyperlink in CALC.
*** Issue 59126 has been marked as a duplicate of this issue. ***
Please don't change the owners of issue!!
No good new for this very important feature who worked fine in OOo 1.1. :?(
the bug is triggered by the fact that the URL to open is handed over to the system, not handled by OOo internally. That can't work as "#" in file URLs are not what they are in e.g. http URLs. The only solution would be *not* to let the system handle the URL (and that's the reason why it works in Word). Changing that is a matter of minutes, but the side effect could be larger than expected. Allowing to handle all URLs internally that OOo can open (detected by pFilter != 0 in the code above) is not wanted, as many other formats like e.g jpg, png etc. surely should preferably handled by the system and the application registered there. Another idea: check for "#" in the URL, and in case there is one, handle the URL internally.
Proposed fix: In sfx2/source/appl/appopen.cxx we have // Mark without URL cannot be handled by hyperlink code if ( bHyperlinkUsed && aFileName.Len() && aFileName.GetChar(0) != '#' ) { // hands over URL to system after some more checks This code assumes that every URL that contains a file name (with any protocol) that was dispatched by clicking a hyperlink may be a candidate for handing it over to the system so that the registered application can be started. IMHO we should do also for file URLs with jump marks: INetURLObject aURL( aFileName ); bool bIsPureHashMark = aFileName.GetChar(0) == '#'; bool bIsFileURLWithHashMark = aURL.GetProtocol() == INET_PROT_FILE && aFileName.SearchAscii("#") != STRING_NOTFOUND; if ( bHyperlinkUsed && aFileName.Len() && !bIsPureHashMark && !bIsFileURLWithHashMark ) { // etc. etc.
> INetURLObject aURL( aFileName ); > bool bIsPureHashMark = aFileName.GetChar(0) == '#'; > bool bIsFileURLWithHashMark = aURL.GetProtocol() == INET_PROT_FILE && > aFileName.SearchAscii("#") != STRING_NOTFOUND; This is not good enough for html links with bookmarks. I think it needs hints about what we can and want to handle and what we absolutely does not handle. On my system (Ubuntu linux) hyperlinks like this: http://en.wikipedia.org/wiki/Openoffice.org#Oracle_Open_Office Works fine now. ...doc#bookmark does not. I have not tried http links on windows. > if ( bHyperlinkUsed && aFileName.Len() && !bIsPureHashMark && > !bIsFileURLWithHashMark ) > { > // etc. etc.
> bool bIsFileURLWithHashMark = aURL.GetProtocol() == INET_PROT_FILE && Aha.. the INET_PROT_FILE should fix the http issue.. argh.. can not delete comments here..
I still see the problem with "Ooo-Dev 3.3 multilingual version English UI WIN XP: [DEV300m82 (Build 9510)]"! TM 3.2 seems to be no longer realistic ;-)
Of course if your doc file is not in the file system, the check for the file system protocol must be removed also. My suggestion was thought as the least invasive change. The general idea of this code is that content that usually is viewed outside of OOo should be handled by the system. This makes sense for html, jpg etc. Bookmarks won't work then if the URL is a file URL as they are not usable with that protocol. In case of doc files the patch makes sense, in case of html files we have to choose if we either want the right application (browser) or the bookmark.
If MS Word or WordViewer is default application for .doc-files on my computer, and I open a .doc file in OpenOffice.org and click on hyperlink to another .doc-file, then this .doc-file opens in MS Word or WordViewer. I can not understand for a second what is right about this. An analogy can be that when Internet Explorer is the default web-browser, and I click on a hyperlink from Opera, the link should be opened in Opera, and not IE, even though IE is the default browser for .html files. This should be REALLY simple to solve. Always check if we (OpenOffice.org) can handle the document (amongst odt,swx,doc,xls,html.....), if not, give it to the OS. This is the _only_ sane behavior. Then a wrapper for the Open dispatch function should be made if you do _not_ want to handle the responce in OOo. Best regards. Knut Olav Bøhmer
when I don't want files to be opened in the same application, for example in firefox, I right-click and click "open in". Should be the same in OOo: Right click and "open in default app" for example (or ctr-alt click)
set target to 3.x since not release relevant for 3.4 release.
Reset assigne to the default "issues@openoffice.apache.org".