in reply to Re: Search and replace in multple MS Word documents
in thread Search and replace in multple MS Word documents

Thanks a lot! Creating documents (xls, doc) is possible, but I was not sure if it was possible to manipulate excisting documents. Performance issues with a lot of documents? I'm very glad with the code (and it ain't VB ;-) ....)
  • Comment on Re^2: Search and replace in multple MS Word documents

Replies are listed 'Best First'.
Re^3: Search and replace in multple MS Word documents
by hominid (Priest) on Sep 03, 2009 at 12:53 UTC
    Performance issues with a lot of documents?
    Shouldn't be. But the specific answer depends on your performance requirements and your definition of "a lot". (358 files doesn't seem like a lot to me.) Just test and see.
    ...but I was not sure if it was possible to manipulate excisting documents.
    Corion's advice about macros is dead on. And after you have seen some of the macro code side by side with the equivalent Perl code, it gets easier to translate between the two. The Word Object Model Reference is a handy information source.
      s~handy~critical~;
        I'm really happy with all the usefull information. I'm not a programmer, but about twice a year, I can avoid a lot of work with 20, 30 lines of Perl code. And if can make this one work, it can save me probably two weeks(!) of work. Manipulating text files is not a real a problem, but Microsoft stuff.... Perl is after all these years still the best choice!
      It's almost working. I have to use a forward slashes (Windows-enviroment...) and I want to use a substitution, due to weird Dutch spelling rules (single / plural). In stead of a fixed text string(?) like: $selection->{Text} = "hippopotamus"; something like: s/(laborant|laboranten)/(MBB-er|MBB-ers)/; (plural: in Dutch it's plus "en" or plus "s" ...) Any elegant suggestions?