Hyperlink to a Word document with '%20' in the filename

N

n777krish

Hello All,

I have a file with the name 'test %20.txt'. Yes, the '%20' is actually
typed in the file name.
When I create a hyperlink to this file in Microsoft Word and Click
this link i get: Cannot open file.

Is there a way to encode the URL so that I can open this file with
this name?

I have tried to actually put in "drive:\...\test%20%2520.txt" into the
hyperlink but this also does not help.

This message also comes up when the Folder path where this document is
stored has '%20' in it.

The same thing happens if there is a '#' in the file name.

All help really appreciated.

Thanks,
Neil Goundar.
 
R

Robert

Greetings--
These are by-products of "Percent-Encoding" which is normally used to
encode Web URLs (have a look at
http://gbiv.com/protocols/uri/rfc/rfc3986.html#when-to-percent-encode).
"%20" is "Percent-Encoding" for a space character.

You could try renaming your file by replacing "%20" with an ordinary space
character. For example, "test%20%2520.txt" should be renamed "test
2520.txt". And if the space character is not mandatory, you could even
rename it "test2520.txt". Same thing with your folder name(s).

When the files have been renamed, you should be able to create and open
hyperlinks to them from Word.
 
N

n777krish

Hi Robert,

Firstly, Thank you for the reply. I really appreciate it.

The problem is that I have a customer who has file names that have
'%20' or '#' in the File Name and Folder name and it is not an option
for me to ask him to manually change all of his files and folders.

I am creating a Word document programatically and inserting some
Hyperlinks into this document. When the file name or path has '%20' or
'#' in it the files cannot be opened from with-in word.

Is there a way to let the path have '%20' or '#' in it and be able to
open the file from the link in Word?
(Maybe some way to encode the %20 and # into the link without having
to change the File and folder names.)

Thank You,
Neil Goundar.
 
R

Robert

Greetings--

The general recommendation is to avoid using so-called "reserved
characters" when naming files. Obviously, MS Word does not like these in
file names.

But I just found a workaround.

For example, if you drag & drop files named "test%20.txt" or "test#2.txt"
from Windows Explorer into a Word (2007) document, these documents will be
inserted as "embedded objects". You will be able to double-click and open
this sort of "hyperlinks" as usual from the corresponding Word documents.
 

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