Try this way,
If condition =
System.IO.Path.GetExtension(CurrentFile.ToString).Equals(".xls") Or
System.IO.Path.GetExtension(CurrentFile.ToString).Equals(".txt") Or
System.IO.Path.GetExtension(CurrentFile.ToString).Equals(".pdf")
Regards,
Gowtham K
