I believe you are correct as to the scope of a public variable declared outside of a procedure. See
Understanding scope and visibility (VBA) | Microsoft Docs. I suspect that "FilePath" is not the best name for your variable. I would suggest:
Code:
Public strFilePath as String
[Edit for future readers of this thread: See my later responses about document variables and Greg Maxey's about class modules (like ThisDocument) later in this thread. How to use such a variable depends on what kind of template/document it is being used in.]