Re: Rename all files in a folder



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

.



Relevant Pages

  • Re: Rename all files in a folder
    ... Although API, FSO, Windows Scripting won't do me any good on my home MacWord ... Is there a way to call a Perl script and use regular expressions with VBA? ...
    (microsoft.public.word.vba.general)
  • Re: recursive folders?
    ... FSO has it's place, but it isn't on every machine. ... the file finding API functions. ... work in a controlled environment where I can quickly restore WSR. ... >> API as it will work on all machines. ...
    (microsoft.public.vb.general.discussion)
  • Re: API vs. FSO
    ... > access files of any type built right in (not true with FSO). ... By VB's runtime, do you mean the API functions or functions like Dir, etc? ... > some virus scanners hate scripting of any kind. ...
    (microsoft.public.vb.general.discussion)
  • Re: Datenbank mit andere Arbeitsgruppe öffnen
    ... Klassen und Collections in Access instanziieren bei weitem langsamer als eine Type Library. ... OK, beweisen werde ich das nicht können, weil ich fso nicht einsetze. ... Und wieviele tausend hast Du gefunden, als Du nach API und Bug oder VBA Class Bug gegruppengurgelt hast? ... hinsichtlich des Festplattenspeichers hast Du hier recht. ...
    (microsoft.public.de.access)
  • Re: recursive folders?
    ... My own library functions use both FSO and the ... >API, depending on how important the speed of the function is. ... >work in a controlled environment where I can quickly restore WSR. ...
    (microsoft.public.vb.general.discussion)

Loading