This tool definitely falls into the do-it-yourself category. Launch the new Windows Forms application. Paste the code shown below. Place a shortcut on the program on the desktop. To use it, drag the file from Explorer to the form. Go to Visual Studio and type Ctrl + V.
Public Class Form1 Public Sub New() InitializeComponent() Me.AllowDrop = True End Sub Protected Overrides Sub OnDragEnter(ByVal e As DragEventArgs) If e.Data.GetDataPresent("FileDrop") Then e.Effect = DragDropEffects.Copy End Sub Protected Overrides Sub OnDragDrop(ByVal e As DragEventArgs) Dim files = DirectCast(e.Data.GetData("FileDrop", False), String()) Dim txt As New System.Text.StringBuilder Dim lines = System.IO.File.ReadAllLines(files(0)) For ix As Integer = 0 To lines.Length - 1 txt.Append("""" + lines(ix).Replace("""", """""") + """") If ix < lines.Length - 1 Then txt.AppendLine(" & _") Next Clipboard.SetText(txt.ToString()) End Sub End Class
The best mousetrap is to add a file as a resource instead of hard-coding text.
source share