P
Poseur
Anyone have an idea why this doesn't work?
In my "Document_Open" routine, if the document name format is
a certain pattern, e.g. "1499011_1292004.doc", then I want to
run certain routines on it:
If ActiveDocument.Name Like "[0-9]@_[0-9]@.doc" Then...
' or "[0-9]{6,8}_[0-9]{6,8}.doc"
But it always yields a false.
When I just run the standard examples out of Help like:
"F" Like "[A-Z]" it comes out True.
If I separate it out into variables:
strDocName = ActiveDocument.Name '"1499011_1292004.doc"
boolResult = strDocName Like "[0-9]@_[0-9]@.doc"
If boolResult Then
Still false.
When I assign variables like above and watch the locals,
Document.Name is "1499011_1292004.doc" not "C:\Folder\1499011_
1292004.doc"
I've tried escaping the "_" just in case even tho it is not a
special character in this system: "\_" or "[_]" or even "[\_]"
What am I missing here?
In my "Document_Open" routine, if the document name format is
a certain pattern, e.g. "1499011_1292004.doc", then I want to
run certain routines on it:
If ActiveDocument.Name Like "[0-9]@_[0-9]@.doc" Then...
' or "[0-9]{6,8}_[0-9]{6,8}.doc"
But it always yields a false.
When I just run the standard examples out of Help like:
"F" Like "[A-Z]" it comes out True.
If I separate it out into variables:
strDocName = ActiveDocument.Name '"1499011_1292004.doc"
boolResult = strDocName Like "[0-9]@_[0-9]@.doc"
If boolResult Then
Still false.
When I assign variables like above and watch the locals,
Document.Name is "1499011_1292004.doc" not "C:\Folder\1499011_
1292004.doc"
I've tried escaping the "_" just in case even tho it is not a
special character in this system: "\_" or "[_]" or even "[\_]"
What am I missing here?