looking for file extensions

  • Thread starter Thread starter JohnE
  • Start date Start date
J

JohnE

This is probably an easy item but oddly enough I am not grasping it. I need
to look for files with extensions ending in .Description. What is in front
of the .Description can be almost anything (ex; ~(readme.txt).Description).
The .Description is used for certain parts. What I need to do in the line
below is to limit only to the .Description. Only the line is question is
shown here. All else works.

If fnd = "~info.txt" Or fnd = ".Description" Then

How do I limit it to only the .Description?
Thanks
.... John
 
JohnE said:
This is probably an easy item but oddly enough I am not grasping it. I
need
to look for files with extensions ending in .Description. What is in
front
of the .Description can be almost anything (ex;
~(readme.txt).Description).
The .Description is used for certain parts. What I need to do in the line
below is to limit only to the .Description. Only the line is question is
shown here. All else works.

If fnd = "~info.txt" Or fnd = ".Description" Then

How do I limit it to only the .Description?


I'm not sure I understand what you're asking. If you just want to rephrase
the If statement so that it returns True if fnd ends with the string
".Description", you could try this:

If fnd = "~info.txt" Or fnd Like "*.Description" Then
 
Thanks for the response. What I am looking for is to recognize the
..Description extension since what is in front of the extension could be any
length. The full loop is below.

Do While fnd <> ""
If fnd = "~info.txt" Or fnd =".Description" Then
'do not count
Else
cnt = cnt + 1
End If

fnd = Dir
Loop

Thanks
.... John
 
Back
Top