Anomaly when inserting hyperlink into an email

R

Rick

I notice that when I insert a Hyperlink into an email, and that link is
a file, if the filename contains a '#' then the link won't load
correctly when the recipient clicks on it. Outlook seems to treat a
pound sign inside a filename to indicate the end of the filename. So if
I insert a hyperlink to--

C:\THIS IS DOC #247.DOC

then when my recipient clicks on the link it can't find the file because
Outlook will be looking for a file named "THIS IS DOC". Thanks for any
thoughts on this.
 
V

VanguardLH

Rick said:
I notice that when I insert a Hyperlink into an email, and that link is
a file, if the filename contains a '#' then the link won't load
correctly when the recipient clicks on it. Outlook seems to treat a
pound sign inside a filename to indicate the end of the filename. So if
I insert a hyperlink to--

C:\THIS IS DOC #247.DOC

then when my recipient clicks on the link it can't find the file because
Outlook will be looking for a file named "THIS IS DOC". Thanks for any
thoughts on this.

First of all, a hyperlink to a hard drive path is unusable by the
recipient of your e-mail because obviously they don't have your hard
drive. Even if they mapped to it over the network and you had file
sharing enabled, they already have the C: drive designator assigned to
their own hard drive. You will need to enable file sharing on your host
and then provide a UNC to that file, like //host/<path>. Or put the
file on a web or ftp server and provide the http://<path> or
ftp://<path> link to it there.

Second, the pound sign has special significance in a URL (if that is
what you are actually providing to the e-mail recipient). "?" is used
to start a list of parameters that are included in the URL and can be
used by scripts on the server to extract those parameters. "#" is used
to identify "anchors" on a web page. These are like bookmarks that
allow pointing to a specific point in a web page. Ever go to a web page
that lists a bunch of articles and when you click on them will take you
to that topic which you could have also found by scrolling down the
page? It used an anchor to point at that spot in the page, like having
Post-It tabs sticking out from pages in a closed book. See
http://www.case.edu/help/introHTML/TCh6.html. As an example, go to
http://www.popupcop.com/help/faq.html. Hover the mouse over the links
and notice in the status bar that some of them have "#n" in their URL.
That takes you to that web page AND to that anchor point on that web
page.

If you want to include special characters in a URL, use the entity code
for them. Use "%xx" where xx is the hexidecimal value (from the ASCII
character chart) for that character. Space character is %20. Pound
character is %23. The percent character is the escape character in a
URL to indicate the numeric value is the hex value for the ASCII
character.
 
R

Rick

Right about the hard drive -- the file is actually not on my hard drive
but on a network drive -- I just inadvertently used C:\ as an (obviously
bad!) example in my post to explain the situation.

As for the "#" -- the hyperlink is not to a URL, though I guess Outlook
is treating it that way? I'm trying to link to a file, not a web page.
Maybe a link to a file gets treated as a link to a URL? Is there any
other way to do this? All we're doing is clicking on the Recent Files
button (or browsing to the directory via the 'browse for file' button),
and then double-clicking on our file. If the file happens to have a
'#' in the name, the link won't work for the recipient; if it doesn't,
it'll be fine.

A '#' is certainly a legal character in a filename.

Thanks for any more thoughts; appreciate your help.
 
R

Rutabaga

Good question, Rick. I'm sorry I don't have the answer. I'm chiming in here
because I'm experiencing essentially the same thing.

When I compose an email with a link to a specific cell in an Excel file, the
address includes the '#' to point to the bookmarked cell. When I click on
the link *before* sending the email, the file opens to that point. However,
*after* sending the email, the link only opens the Excel file without regard
to the bookmark. This holds true whether I try it from my Sent folder, or
whether a recipient tries to open it.

When I hover over the link, the address displays correctly, with the '#' and
the bookmarked cell. But when I click on the link, a dialog box with the
title "Opening Mail Attachment" opens, which only points to the Excel file,
and not to the bookmark within.

Would really like to find an answer to this. It would be a great
convenience to my email recipients to be able to open files I send to a
specific location.

FWIW, I'm using Office 2003 on XP OS.

Regards,
Luke
 
R

Rick

Thanks for this. Similar situation.

It does look as if there is a limitation to the Insert Hyperlink
feature: if you use it to link to a file, that file may not contain a
'#' character.

Anyone else have any thoughts on this?
 
R

Rutabaga

It appears the limitation you mention, or one similar to it, does exist in
Outlook, and maybe the rest of the Suite. The curious thing, in my case at
least, is that the limitation doesn't manifest itself until after the mail is
sent. Clicking the link before Send opens the doc to the specified location.
I know, I already said all that.

It's lonely in this thread (no offense, Rick). I'd have thought this
problem would have been more common.
 
V

VanguardLH

Rick said:
Right about the hard drive -- the file is actually not on my hard drive
but on a network drive -- I just inadvertently used C:\ as an (obviously
bad!) example in my post to explain the situation.

As for the "#" -- the hyperlink is not to a URL, though I guess Outlook
is treating it that way? I'm trying to link to a file, not a web page.
Maybe a link to a file gets treated as a link to a URL? Is there any
other way to do this? All we're doing is clicking on the Recent Files
button (or browsing to the directory via the 'browse for file' button),
and then double-clicking on our file. If the file happens to have a
'#' in the name, the link won't work for the recipient; if it doesn't,
it'll be fine.

A '#' is certainly a legal character in a filename.

URL = Uniform Resource Locator

http:// is just *one* of the type of URLs. There is also gopher:,
mailto:, ftp://, and others - and they are *all* URLs. There is also
the file:// URL. You are tryping to create a hyperlink in an e-mail
document. It is still a URL. URL is *not* just for web sites. There
is no "web" in Uniform Resource Locator.

Read ftp://ftp.rfc-editor.org/in-notes/rfc1738.txt. file:// is a URL
scheme for identifying an object. Section 3.10 describe the file URL
scheme. What I told you about escaping special characters in a URL
still applies. Instead of using:

//hostname/<path>/myfile#foo

which is having the application default to the http:// URL scheme (it
has to guess at something since you chose to omit the URL scheme prefix)
and figures the #foo.bar is an anchor on a web page named foo.bar, use:

file://hostname/<path>/myfile%23foo.bar

If you have spaces in your path or filename (which you showed) then make
sure to use the numeric entity code for the space character, too.
Outlook isn't the one misinterpreting the incomplete URL that you
specified. You did not specify which URL type was meant by your string
so Outlook had to guess that you meant to use the http:// URL scheme.
If you don't want an application as to which URL scheme you want to use
then specify it.
 
R

Rick

Right; I had the same feeling! That's why I'm wondering if other people
have found some way around this.
 
R

Rick

Ah, thanks much for the excellent explanation. I think I hadn't fully
realized that a filepath on a network is, in a manner of speaking,
simply one type of URL: a file URL.

When inserting the link, when I prefix the file pathname with "file://"
to force it to interpret the path as a FILE URL rather than an INTERNET
URL, I'm curious about why it still doesn't recognize "#" as a regular
character in my filename. As you suggest, I still need to use '%23'
even when Outlook knows it's a file URL rather than an internet URL. I
guess "#" has special significance for ALL URL's, not just INTERNET
URL's.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top