Re: Rename all files in a folder
- From: Russ <drsN0SPAMmikle@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 Jul 2007 05:31:35 -0400
So what API hooks do you use to rename files? What function names?
Although API, FSO, Windows Scripting won't do me any good on my home MacWord
2004; I do use a W2K OS, Word97 at work.
I guess in my MacWord 2004, I'd use VBA to call an AppleScript to call a
UNIX shell and use regular expressions to rename my files. That particular
macro wouldn't work in a Windows environment, however.
Is there a way to call a Perl script and use regular expressions with VBA?
That might be useful on both a Windows and Mac platform.
old man <oldman@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I don't want to engage you in a deep discussion on this but I would just
like to respond to several things you said:
The timing example was for 1601 files and it was ten times as long using FSO
but for a typical rename (even 100 files) I don't believe users would notice
the difference.
Agreed. Not that I think that's a valid basis for neglecting the potential
downside
with FSO.
While I use APIs extensively I have seen many VBA people
avoid APIs
Agreed.
(indeed the example you noted is from a VBNET group).
Randy's actually been using that name since long before Microsoft "discovered"
the
Internet. <g> Has nothing to do with the (horridly misnamed!) vb.net product
they
later shipped.
The file needed to use FSO is scrrun.dll has been available for Windows at
least since Win98 so its quite common.
Agreed. In many flavors. "So many to choose from!", and all that. <g>
I have seen corporate clients remove sccrun.dll in an effort to tighten up
their systems but if users can enable VBA projects and set security level to
low the door is pretty much open anyway (or at least dependent on scanning
emails and files thoroughly.)
Agreed.
I still believe that if a user does not want to use API's (which have their
own issues such as error handling....) they should consider using FSO which
is as much a part of VBA as the use of API's.
Disagree. Violently. (As you've probably noticed. <g>) There are virtually
no
"issues" with using APIs other than becoming mildly familiar with them.
Examples
also abound. Error handling is actually far simpler -- there really isn't
any.
Native file i/o is also superior to FSO. Indeed, the only situation where FSO
is
warranted is in scripting languages (like VBScript) that can't access the API
and
don't have native file i/o functionality. FSO is no more a part of VBA than
is the
AutoCAD object model. It's an wholly external library.
with respect
Agreed. :-)
--
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
.
- Follow-Ups:
- Re: Rename all files in a folder
- From: Karl E. Peterson
- Re: Rename all files in a folder
- From: old man
- Re: Rename all files in a folder
- References:
- Re: Rename all files in a folder
- From: Jay Freedman
- Re: Rename all files in a folder
- From: old man
- Re: Rename all files in a folder
- From: Jules
- Re: Rename all files in a folder
- From: old man
- Re: Rename all files in a folder
- From: Karl E. Peterson
- Re: Rename all files in a folder
- From: Karl E. Peterson
- Re: Rename all files in a folder
- From: old man
- Re: Rename all files in a folder
- From: Karl E. Peterson
- Re: Rename all files in a folder
- Prev by Date: Re: Edit/Replace to end of line
- Next by Date: Re: disbursing macro
- Previous by thread: Re: Rename all files in a folder
- Next by thread: Re: Rename all files in a folder
- Index(es):
Relevant Pages
|
Loading