jagrenet
Board Regular
- Joined
- Feb 23, 2022
- Messages
- 81
- Office Version
- 365
- 2013
- 2011
- 2010
- Platform
- Windows
Hello Gurus,
I have a question regarding the process mentioned in the Title.
When working with the "Document.Open" method, I have one particular document that the filename changes or varies just slightly from client to client.
For instance -
wd.Documents.Open("C:\Monthly_Reports\Customer_01\My Customer Report - John.docx")
Or
wd.Documents.Open("C:\Monthly_Reports\Customer_02\My Customer Report - Mary.docx")
Or
wd.Documents.Open("C:\Monthly_Reports\Customer_03\My Customer Report - Bob.docx")
My question is, can I use an asterisk in place of the client's name, (John, Mary, Bob) to have the code still open that document? If so, what is the format for the asterisk ..... does it require quotation marks, or a dot?
Such as -
wd.Documents.Open("C:\Monthly_Reports\Customer_01\My Customer Report - "*".docx")
Or
wd.Documents.Open("C:\Monthly_Reports\Customer_01\My Customer Report - *.docx")
I suppose I am asking if the asterisk can be used as a wildcard character in the filepath string and is that even "allowed"?
Thanks in advance,
Jeff
I have a question regarding the process mentioned in the Title.
When working with the "Document.Open" method, I have one particular document that the filename changes or varies just slightly from client to client.
For instance -
wd.Documents.Open("C:\Monthly_Reports\Customer_01\My Customer Report - John.docx")
Or
wd.Documents.Open("C:\Monthly_Reports\Customer_02\My Customer Report - Mary.docx")
Or
wd.Documents.Open("C:\Monthly_Reports\Customer_03\My Customer Report - Bob.docx")
My question is, can I use an asterisk in place of the client's name, (John, Mary, Bob) to have the code still open that document? If so, what is the format for the asterisk ..... does it require quotation marks, or a dot?
Such as -
wd.Documents.Open("C:\Monthly_Reports\Customer_01\My Customer Report - "*".docx")
Or
wd.Documents.Open("C:\Monthly_Reports\Customer_01\My Customer Report - *.docx")
I suppose I am asking if the asterisk can be used as a wildcard character in the filepath string and is that even "allowed"?
Thanks in advance,
Jeff