Hi,
I'd like to replace "D:\Test\test.txt" with SelectedFile (a variable storing drive, directory, file names). But if I put SelectedFile on the spot where "D:\Test\test.txt" exists, I get an error.
How can I deal with this problem?

'/////////////////////
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
Set w = CreateObject("Word.Application")
SelectedFile = File1.FileName

w.Documents.Open FileName:="d:\Test\test.txt", ConfirmConversions:=False, ReadOnly _
:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
End Sub