Selecting .dox and .docx using Dir$

N

Neil Humphries

How can the line:
myFile = Dir$(PathToUse & "*.doc")
be modified to look for both *.doc and *.docx files?
"*.doc?" won't work for me as I don't want to include "*.docm" files.
 
D

Doug Robbins - Word MVP

You may need to run the routine twice by repeating the block of code, once
with doc and the other time with docx

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
N

Neil Humphries

I was afraid of that. Thanks.

Doug Robbins - Word MVP said:
You may need to run the routine twice by repeating the block of code, once
with doc and the other time with docx

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Jay Freedman

You could still use "*.doc?" and then examine the extension of each returned
file before doing anything with it.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.
 
N

Neil Humphries

I'll have to check the initial call and all the subsequent calls. I was
hoping the MS might have added a constant or something to enable you to
select only standard word docs the same way it handles files with/without
attributes. Thanks for your suggestion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top