|
-
Apr 18th, 2012, 10:24 AM
#1
Thread Starter
New Member
[RESOLVED] Copy File Link to Clipboard
Hi all,
I almost feel silly asking as I feel like the answer is staring me in the face, but I haven't been able to find anything on Google that actually helps my specific issue.
The origin of the issue is moot, but I have an Excel Addin with a button that I would like to use to copy a link to the workbook that is currently active. I am able to get the text to copy to the clipboard, however when I paste it in Word or an Email, it pastes as plain text, but I want a link. Is this possible? I've played with different DataFormats, but I don't think I quite grasp how to use that. Below is what I currently have:
Code:
Private Sub btnCopyLink_Click(sender As System.Object, e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles btnCopyLink.Click
Dim objBook As Excel.Workbook = Globals.ThisAddIn.Application.ActiveWorkbook
If MsgBox("Copy a link to " & objBook.FullName & " to the clipboard?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Copy Link?") = MsgBoxResult.No Then Exit Sub
My.Computer.Clipboard.Clear()
My.Computer.Clipboard.SetText("file:///" & objBook.FullName)
End Sub
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|