Syntax error in code

A

AusTexRich

Hi,
I'm getting a Syntax error on this line.

If FileExists(strPath) = True

What could be the reason for that?

Here's the all of the code:
 
G

George Nicholson

Look at the VB help entry for FileExists. It is not a standalone function.
Its a method of a FileSystem object (which needs to be specified and isn't
in your code.).

If you need a standalone function use Dir(). It will return an empty string
if the files does not exist.

If Len(Dir(strpath))>0 Then

HTH,
 
Top