Your code and how you're using it is amystery to me.

Why are you passing 'FileName' to the function, then ignoring that and substituting ThisDocument.Path? And did you test what Dir(FileName) actually returns?

In any event, since the code presumably resides in a template, ThisDocument.Path would return the template's path, not the document's - and you couldn't use ActiveDocument.Path until the document has been saved. Moreover, I can't see that a Function that merely returns a boolean result is of any benefit.