Dir() command

B

Bob Anderson

I am using a Macro in Word. This is embedded in a
subroutine. The VB code is as follows
Dim testfile as varient, x as variable

testfile = Dir(filename(x , 2))

[testfile is empty, filename(x , 2)
is "c:\child\myfile.doc"
The file IS in the directory and I have changed the
arguement on the Filename(x, 2) but this sees the file
correctly. Is there something in the properties of the
Word document that I should change? The error says there
is no file found, (5174) but it is spelled correctly.
Thank you
 
H

Helmut Weber

Hi Bob,
2 represents "vbhidden".
Use 0 or vbnormal instead,
where it is assumed Your are using VBA, not VB.
Greetings from Bavaria, Germany
Helmut Weber
 

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