ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HELP: email file path as a hyperlink in outlook body (https://www.excelbanter.com/excel-programming/435683-help-email-file-path-hyperlink-outlook-body.html)

Sam

HELP: email file path as a hyperlink in outlook body
 
Hi All,

I am trying to send a file path as a hyperlink in outlook once user clicks
"Submit" on an excel userform.

I am able to send the path, but the hyperlinking doesnt work on all of the
path, maybe because of a space in the file name?

Here is what I have so far..

With OutMail
.to = "
.CC = ""
.BCC = ""
.Subject = "Hyperlink test "
.Body = "Hyperlink: " & "C:\Documents" & Me.FileName.Value

..Send

Here Me.FileName.value is the actual file name that it will be saved with.
The file name has a space somethign like "abc 123"

Hope I made it clear.

Thanks in advance


Ron de Bruin

email file path as a hyperlink in outlook body
 
Try

.Body = "file://Yourcomputer/YourFolder/Week2.xls"


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"sam" wrote in message ...
Hi All,

I am trying to send a file path as a hyperlink in outlook once user clicks
"Submit" on an excel userform.

I am able to send the path, but the hyperlinking doesnt work on all of the
path, maybe because of a space in the file name?

Here is what I have so far..

With OutMail
.to = "
.CC = ""
.BCC = ""
.Subject = "Hyperlink test "
.Body = "Hyperlink: " & "C:\Documents" & Me.FileName.Value

.Send

Here Me.FileName.value is the actual file name that it will be saved with.
The file name has a space somethign like "abc 123"

Hope I made it clear.

Thanks in advance


Barb Reinhardt

HELP: email file path as a hyperlink in outlook body
 
Have you tried this

..Body = "Hyperlink: " & "C:\Documents" & _
Replace(Me.FileName.Value ," ","%20")

"sam" wrote:

Hi All,

I am trying to send a file path as a hyperlink in outlook once user clicks
"Submit" on an excel userform.

I am able to send the path, but the hyperlinking doesnt work on all of the
path, maybe because of a space in the file name?

Here is what I have so far..

With OutMail
.to = "
.CC = ""
.BCC = ""
.Subject = "Hyperlink test "
.Body = "Hyperlink: " & "C:\Documents" & Me.FileName.Value

.Send

Here Me.FileName.value is the actual file name that it will be saved with.
The file name has a space somethign like "abc 123"

Hope I made it clear.

Thanks in advance


Sam

HELP: email file path as a hyperlink in outlook body
 
Thanks for the help Barb, I cannot replace the space with anything else, The
file is saved with a space in between, "123 455" and I have to get it to work
as a link with the space in the file name,
actually the whole path with the file name as a hyperlink.


"Barb Reinhardt" wrote:

Have you tried this

.Body = "Hyperlink: " & "C:\Documents" & _
Replace(Me.FileName.Value ," ","%20")

"sam" wrote:

Hi All,

I am trying to send a file path as a hyperlink in outlook once user clicks
"Submit" on an excel userform.

I am able to send the path, but the hyperlinking doesnt work on all of the
path, maybe because of a space in the file name?

Here is what I have so far..

With OutMail
.to = "
.CC = ""
.BCC = ""
.Subject = "Hyperlink test "
.Body = "Hyperlink: " & "C:\Documents" & Me.FileName.Value

.Send

Here Me.FileName.value is the actual file name that it will be saved with.
The file name has a space somethign like "abc 123"

Hope I made it clear.

Thanks in advance


Dave Peterson

HELP: email file path as a hyperlink in outlook body
 
I'm not sure what me.filename.value (textbox on a userform???) is, but maybe...

(This is untested...)

dim myFileName as string
myfilename = replace(me.filename.value, " ", "%20")

....
'don't forget the trailing backslash for the path.
..body = "hyperlink: c:\documents\" & myfilename

=========

I would have thought that:
..body = "hyperlink: file:\\\\c:\documents\" & myfilename

Would work better...(But it's still untested)


sam wrote:

Hi All,

I am trying to send a file path as a hyperlink in outlook once user clicks
"Submit" on an excel userform.

I am able to send the path, but the hyperlinking doesnt work on all of the
path, maybe because of a space in the file name?

Here is what I have so far..

With OutMail
.to = "
.CC = ""
.BCC = ""
.Subject = "Hyperlink test "
.Body = "Hyperlink: " & "C:\Documents" & Me.FileName.Value

.Send

Here Me.FileName.value is the actual file name that it will be saved with.
The file name has a space somethign like "abc 123"

Hope I made it clear.

Thanks in advance


--

Dave Peterson

Dave Peterson

HELP: email file path as a hyperlink in outlook body
 
The %20 is hex for the space character.

It's a way to include the space character into the link without confusion.



sam wrote:

Thanks for the help Barb, I cannot replace the space with anything else, The
file is saved with a space in between, "123 455" and I have to get it to work
as a link with the space in the file name,
actually the whole path with the file name as a hyperlink.

"Barb Reinhardt" wrote:

Have you tried this

.Body = "Hyperlink: " & "C:\Documents" & _
Replace(Me.FileName.Value ," ","%20")

"sam" wrote:

Hi All,

I am trying to send a file path as a hyperlink in outlook once user clicks
"Submit" on an excel userform.

I am able to send the path, but the hyperlinking doesnt work on all of the
path, maybe because of a space in the file name?

Here is what I have so far..

With OutMail
.to = "
.CC = ""
.BCC = ""
.Subject = "Hyperlink test "
.Body = "Hyperlink: " & "C:\Documents" & Me.FileName.Value

.Send

Here Me.FileName.value is the actual file name that it will be saved with.
The file name has a space somethign like "abc 123"

Hope I made it clear.

Thanks in advance


--

Dave Peterson

Sam

HELP: email file path as a hyperlink in outlook body
 
Thanks for helping dave,

When i use: Replace(Me.filename.value, " ", "%20") I see "%20" between the
space.
like this:

123%20abc (123 abc: being the original file name)

And yes, Me.filename.value is a textfield in the userform, And I am saving
the file with that field name as the file name

"Dave Peterson" wrote:

I'm not sure what me.filename.value (textbox on a userform???) is, but maybe...

(This is untested...)

dim myFileName as string
myfilename = replace(me.filename.value, " ", "%20")

....
'don't forget the trailing backslash for the path.
..body = "hyperlink: c:\documents\" & myfilename

=========

I would have thought that:
..body = "hyperlink: file:\\\\c:\documents\" & myfilename

Would work better...(But it's still untested)


sam wrote:

Hi All,

I am trying to send a file path as a hyperlink in outlook once user clicks
"Submit" on an excel userform.

I am able to send the path, but the hyperlinking doesnt work on all of the
path, maybe because of a space in the file name?

Here is what I have so far..

With OutMail
.to = "
.CC = ""
.BCC = ""
.Subject = "Hyperlink test "
.Body = "Hyperlink: " & "C:\Documents" & Me.FileName.Value

.Send

Here Me.FileName.value is the actual file name that it will be saved with.
The file name has a space somethign like "abc 123"

Hope I made it clear.

Thanks in advance


--

Dave Peterson
.


Sam

email file path as a hyperlink in outlook body
 
Thanks for helping ron,

I have spaced in between so i am not able to show the entire thing as a link,

the path is somewhat like:

C:\My Documents\

there is a space between "My" and "documents"

File name is:

Me.filename.value

There is a space between in file name as well, eg, "123 abc"



"Ron de Bruin" wrote:

Try

.Body = "file://Yourcomputer/YourFolder/Week2.xls"


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"sam" wrote in message ...
Hi All,

I am trying to send a file path as a hyperlink in outlook once user clicks
"Submit" on an excel userform.

I am able to send the path, but the hyperlinking doesnt work on all of the
path, maybe because of a space in the file name?

Here is what I have so far..

With OutMail
.to = "
.CC = ""
.BCC = ""
.Subject = "Hyperlink test "
.Body = "Hyperlink: " & "C:\Documents" & Me.FileName.Value

.Send

Here Me.FileName.value is the actual file name that it will be saved with.
The file name has a space somethign like "abc 123"

Hope I made it clear.

Thanks in advance

.


Dave Peterson

HELP: email file path as a hyperlink in outlook body
 
That's the purpose of the doing the replace. Instead of two separate strings,
you have a long string.

Did the hyperlink work when you used this?

If no, did you include the "File:////" stuff?

sam wrote:

Thanks for helping dave,

When i use: Replace(Me.filename.value, " ", "%20") I see "%20" between the
space.
like this:

123%20abc (123 abc: being the original file name)

And yes, Me.filename.value is a textfield in the userform, And I am saving
the file with that field name as the file name

"Dave Peterson" wrote:

I'm not sure what me.filename.value (textbox on a userform???) is, but maybe...

(This is untested...)

dim myFileName as string
myfilename = replace(me.filename.value, " ", "%20")

....
'don't forget the trailing backslash for the path.
..body = "hyperlink: c:\documents\" & myfilename

=========

I would have thought that:
..body = "hyperlink: file:\\\\c:\documents\" & myfilename

Would work better...(But it's still untested)


sam wrote:

Hi All,

I am trying to send a file path as a hyperlink in outlook once user clicks
"Submit" on an excel userform.

I am able to send the path, but the hyperlinking doesnt work on all of the
path, maybe because of a space in the file name?

Here is what I have so far..

With OutMail
.to = "
.CC = ""
.BCC = ""
.Subject = "Hyperlink test "
.Body = "Hyperlink: " & "C:\Documents" & Me.FileName.Value

.Send

Here Me.FileName.value is the actual file name that it will be saved with.
The file name has a space somethign like "abc 123"

Hope I made it clear.

Thanks in advance


--

Dave Peterson
.


--

Dave Peterson

JP[_4_]

HELP: email file path as a hyperlink in outlook body
 
Email format? Is it RTF, HTML, or plain text?

Instead of the Body Property, how about the HTMLBody Property?

..HTMLBody = "<p<a href=" & Chr(34) & "C:\My Documents\" &
Me.FileName.Value & Chr(34) & "My File</a</p"

--JP


On Nov 2, 12:29*pm, sam wrote:
Hi All,

I am trying to send a file path as a hyperlink in outlook once user clicks
"Submit" on an excel userform.

I am able to send the path, but the hyperlinking doesnt work on all of the
path, maybe because of a space in the file name?

Here is what I have so far..

With OutMail
* * * * .to = "
* * * * .CC = ""
* * * * .BCC = ""
* * * * .Subject = "Hyperlink test "
* * * * .Body = "Hyperlink: *" *& "C:\Documents" & Me.FileName.Value

.Send

Here Me.FileName.value is the actual file name that it will be saved with..
The file name has a space somethign like "abc 123"

Hope I made it clear.

Thanks in advance




All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com