Link in email doesn't work if underscores in file name (1 Viewer)

projecttoday

Registered User.
Local time
Today, 00:28
Joined
Jan 5, 2011
Messages
51
I'm trying to create a file, save it, create an email with a link to the file in it, and send the email. But the link in the email doesn't work if there are any underscores ("_") in the file name or file path.

The folder that I need to save the file in and link to in the email has underscores ("_") in its name. I cannot rename the folder.

The attached database, when you click on the button, will create an Excel spreadsheet with "RED", "BLUE", and "GREEN" on it, save the spreadsheet in the path you enter with the name 'Test_File' with date and time appended, create an email with a link in it to the spreadsheet, and send the email. You must enter your email or an email address that you can use for testing in the form and enter what you want for the file path. Enter the file path with a slash at the end. Do not enter a file name. Then click on the button and wait a minute or 2 for the email.

When you receive the email, click on the link. It does not work.

If you change 3 statements in the code for frmMain, it will work:

Code:
strNow = Replace(strNow, "/", "_") '<------ Change _ to - and it works
strNow = Replace(strNow, ":", "_") '<------ Change _ to - and it works
filename = "Test_File_" '<------ Change both _ 's to - and it works

Change as indicated.

So how can I get it to work with the underscores? I could actually do away with underscores in the file name but the folder that I need to hit has underscores in its name.
 

Attachments

  • TestDatabase.accdb
    720 KB · Views: 65

Galaxiom

Super Moderator
Staff member
Local time
Today, 14:28
Joined
Jan 20, 2009
Messages
12,860
I expect it is a matter of the email parser recognising the string as a path.

Try writing this format to the message:

file://computer/share/folder/file
 

projecttoday

Registered User.
Local time
Today, 00:28
Joined
Jan 5, 2011
Messages
51
I don't follow. That's what I'm doing, isn't it?
 

Users who are viewing this thread

Top Bottom