I'm trying to rename a series of files for SharePoint that contain illegal characters such as #, &, ~, etc. I modified the code from this site to find the files/folders to rename. When I run the following command
strTemp = Dir(strFolder & "*~*", vbHidden)
(or with any other attributes for that matter) I get a huge list of files in the directory that do not contain a ~
, and yet it still does not seem to find some files that contain an initial ~
(such as temporary files caused by editing a document that were never deleted).
Anybody out there know how to locate those files?
You don't need to replace the constants with the number 6. To combine attributes you can add them using +
, for example:
strTemp = Dir(strFolder & "*~*", vbHidden + vbSystem)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With