Hey,
So right now I have this code working correctly (at bottom). I have it so when a File is selected in listbox1 and button1 is pressed it will copy the file and place a underscore before it (Example: "_ File.mov")
I would like to change it up a bit and change it so that I can have textbox2 be a location that the user can put what they want in front of the file after it is copied. (Example: File.mov, user puts in textbox: 77, would copy to 77File.mov)
Now I have tried changing the code to:
Code:
Dim CopyFormat = "C:\Server Media\LIVE\" + textbox2.text
'or
Dim CopyFormat = "C:\Server Media\LIVE\" + "textbox2.text"
'or
Dim CopyFormat = "C:\Server Media\LIVE\" + (textbox2.text)
Error I keep getting: "Object reference not set to an instance of an object." I'm guessing it just needs to be written a different way?
Full Code for this section:
Code:
Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
Dim MediaLocation = "C:\Server Media\LIVE\"
Dim CopyFormat = "C:\Server Media\LIVE\" + "_ "
Try
For Each o As Object In ListBox1.SelectedItems
My.Computer.FileSystem.CopyFile(MediaLocation & o.ToString, CopyFormat & o.ToString)
Next
Catch ex As Exception
MsgBox("Clip already exists", MsgBoxStyle.Critical, "Error")
End Try
End Sub