Hyperlink in clipboard for Outlook Email

R

ryanmhuc

Is it possible to create a hyperlink and place this in the clipboard
so you can paste it into an Outlook email. I know i can do something
like this

"<file:///E:\Profile\Desktop\dropbox\sharepoint.docx>"

And then after a return it will hyperlink. But i would like the link
and the text to be different.
 
T

Tony Jollans

Copy (and Paste) will copy a hyperlink along with any displayed text. If
your problem is really just that you want text and address to be different
in the first place, use the hyperlinks dialog - you don't say what version
of Word you are using but placing the insertion point in the hyperlink and
pressing Ctrl+K works in all versions.
 
R

ryanmhuc

Copy (and Paste) will copy a hyperlink along with any displayed text. If
your problem is really just that you want text and address to be different
in the first place, use the hyperlinks dialog - you don't say what version
of Word you are using but placing the insertion point in the hyperlink and
pressing Ctrl+K works in all versions.

--
Enjoy,
Tony






- Show quoted text -

Tony thanks for the suggestion but I'm asking how you accomplish this
in VBA. Obivously using the copy and paste from the keyboard will work
but how do you create the same affect using VBA and the clipboard
 
T

Tony Jollans

I'm not entirely sure what you want. This is a Word group so do you want to
know how to create a hyperlink in Word VBA. If so, try this:

(range_reference).Hyperlinks.Add Anchor:=Selection.Range, _
Address:="http://www.example.com", TextToDisplay:="Example text"

If you want to copy a hyperlink to the clipboard, then this:

(range_reference).Hyperlinks(1).Range.Copy

If you want to conjure the hyperlink out of thin air and on to the clipboard
without an intermediate step, I'm not sure that can be done.

Or are you actually in Outlook? And if so, what version?

--
Enjoy,
Tony

Copy (and Paste) will copy a hyperlink along with any displayed text. If
your problem is really just that you want text and address to be different
in the first place, use the hyperlinks dialog - you don't say what version
of Word you are using but placing the insertion point in the hyperlink and
pressing Ctrl+K works in all versions.

--
Enjoy,
Tony






- Show quoted text -

Tony thanks for the suggestion but I'm asking how you accomplish this
in VBA. Obivously using the copy and paste from the keyboard will work
but how do you create the same affect using VBA and the clipboard
 

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