You should not have any spaces between your file declarations. Try this
Using fold As New OpenFileDialog
fold.Filter = "document files (*.doc)|*.docx|richtextformat files (*.rtf)|*.rtf|All files (*.*)|*.*"
fold.Title = "Select file"
If fold.ShowDialog() = Windows.Forms.DialogResult.OK Then
fold.RestoreDirectory = True
MessageBox.Show("You selected " & fold.FileName)
End If
End Using
Hope this helps