It could be a little bit more complex if you want to search case insensitive, but something like this:
lea eax,[fd.cFileName]
push eax
call [lstrlen]
cmp eax, 5
jbe .not_found ; at least 6 characters name.
cmp dword [fd.cFileName+eax-5],'.doc' ; extension comparing
jne .not_found
cmp byte [fd.cFileName+eax-1], 'x'
jne .not_found
.found:
; some code
.not_found:
; some other code...