hmmmmmmmmmmm i’ve tried this over and over in different ways doesnot work but i name button command74
This is code already test and working fine.
I’m using keypress event just for textbox not for the button.
If you want to use button to play it then use button default event (click event) and don’t change it with any events like keypress event.
Also please confirm that your textbox name is URLAddr and button name is Command1 to make this working.
I hope you can handle it.
Private Sub Command1_Click()
Dim VideoAddr As String
VideoAddr = Replace(URLAddr.Text, “/watch?v=”, “/v/”)
WindowsMediaPlayer1.URL = VideoAddr
End Sub
my code
Private Sub Command74_Click()
Dim VideoAddr As String
VideoAddr = Replace(URLAddr.Text, “/watch?v=”, “/v/”)
WindowsMediaPlayer1.URL = VideoAddr
End Sub