Created
September 28, 2012 14:08
-
-
Save fzawada/3800089 to your computer and use it in GitHub Desktop.
Copies current document path to clipboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Strict Off | |
Option Explicit Off | |
Imports System | |
Imports EnvDTE | |
Imports EnvDTE80 | |
Imports EnvDTE90 | |
Imports EnvDTE90a | |
Imports EnvDTE100 | |
Imports System.Diagnostics | |
Imports System.Windows.Forms | |
Public Module RecordingModule | |
Private fullPathToFile As String | |
Sub CopyDocumentPath() | |
fullPathToFile = DTE.Windows.DTE.ActiveDocument.Path + _ | |
DTE.Windows.DTE.ActiveDocument.FullName | |
Dim thread As New Threading.Thread(AddressOf CopyToClipboard) | |
thread.ApartmentState = Threading.ApartmentState.STA | |
thread.Start() | |
thread.Join() | |
End Sub | |
Private Sub CopyToClipboard() | |
'The second parameter is required | |
Clipboard.SetDataObject(fullPathToFile, True) | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment