API, skip temp files

I have a macro that will perform several operations on all the documents in a selected folder but it also selects all the temp files that are left over after a crash so I am trying to find a way to have the temp files skipped. I would like to use some code that will skip the file if the file name includes any special characters (for example ~ and $). Can anyone explain how to do this? Or is there a better way to handle this? Of course I could always just delete all the temp files prior to running the program but I would like for the user to not have to worry about doing that.

Thanks

Sam

Reply to
Sam
Loading thread data ...

My first thought is that as you get to each file, check for the presence of those characters (instring function?) and then skip to the next one in the list if you do find them.

WT

Reply to
Wayne Tiffany

Thanks Wayne, that worked. I am not an educated programmer and was not aware of the instr function. I set it up so that if instr returns zero (character not found) the file is processed otherwise the file is skipped.

Thanks again

Reply to
Sam

Sam,

You would also write an old school bat routine that will automatically delete those files. Ok, actually, you could do it in S/W Api too, but will be a bit more involved. Can macros call *.bat files?

Matt

CS wrote:

Reply to
fcsuper

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.