topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday June 12, 2021, 8:56 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Batch Word Text Replacer  (Read 2286 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Batch Word Text Replacer
« on: January 24, 2021, 04:58 PM »
With Acrobat I can replace in a pdf collection a text string.

I need a free to replace in a word collection files replace any string .
I can with notepad++ or with DocFetcher find any string in any collection of microsoft word files.
I am using microsoft word 2010.
If I try to use notepad++ for finding and replacing the word files i corrupt them. So I can only use notepad++ to find, but not to replace.

I need someone with experience doing this work to recommend me the most simple, preferably free, program.

Best Regards

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #1 on: January 24, 2021, 05:24 PM »
I tried with Gillmeister word text replacer but don't go. The program hangs and do nothing.
 :-[

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,506
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #2 on: January 24, 2021, 06:21 PM »

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #3 on: January 24, 2021, 07:17 PM »
You can give this a try:
https://www.datanume...iple-word-documents/
I am trying long time ago with this sort of program.
So : Have you try that script or the program ? Do you use this program ?


I hardly can remember the VBA Find and Replace as useful.
https://gregmaxey.co...ind_and_replace.html


This sort of utilities are very painful sometimes. corrupt files. you need to backup everywhere.
 :tellme: :-[

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #4 on: January 24, 2021, 07:26 PM »
I don't remember this one either

http://www.gmayor.co..._batch_processes.htm
 :-[ :-\

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,506
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #5 on: January 25, 2021, 02:25 AM »
You can give this a try:
https://www.datanume...iple-word-documents/
I am trying long time ago with this sort of program.
So : Have you try that script or the program ? Do you use this program ?

I don't have/use Word or VBA, if I did I'd probably use PowerShell interfacing to Word to do the same thing instead.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #6 on: January 25, 2021, 09:45 AM »
You can give this a try:
https://www.datanume...iple-word-documents/
I am trying long time ago with this sort of program.
So : Have you try that script or the program ? Do you use this program ?

I don't have/use Word or VBA, if I did I'd probably use PowerShell interfacing to Word to do the same thing instead.
Ojú !!!!!!!!!! Then you don't have used datanumen .
I would prefer an advice if you are using this tool or know at first hand someone doing.
Best Regards

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #7 on: January 25, 2021, 09:47 AM »
I don't remember my prior use of the VBA scripts. Seems for old versions of word o something goes wrong when replacing.

So I would like a tool tested and running with word 2010.

 :-[

Note : the important thing after replacing is not obtain corrupted word files I can't open.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,506
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #8 on: January 25, 2021, 07:28 PM »
Ojú !!!!!!!!!! Then you don't have used datanumen .
I would prefer an advice if you are using this tool or know at first hand someone doing.

No problem ... however that VBA module is from 2017 and I've just tested it on Word 2003 and it worked ...
« Last Edit: January 26, 2021, 06:02 AM by 4wd »

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,804
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #9 on: January 25, 2021, 08:43 PM »
So I would like a tool tested and running with word 2010.

Just a note: Office 2010 is not supported anymore by Microsoft, in the same way that Windows 7 isn't supported anymore. It is Office 2013 or bust (in the eyes of Microsoft). For the next 2 years still, after that no more support for Office 2013 either. 

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #10 on: January 26, 2021, 09:33 AM »
Ojú !!!!!!!!!! Then you don't have used datanumen .
I would prefer an advice if you are using this tool or know at first hand someone doing.

No problem ... however that VBA module is from 2017 and I've just tested it on Word 2003 and it worked ...
Then running to try.
 :-* :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #11 on: January 26, 2021, 10:03 AM »
I am doing something wrong.
No replaces at all.
As works inside a folder a create a folder with the word files. Try a string a see no change.
 :-[

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,138
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #12 on: January 26, 2021, 02:41 PM »
Try HandyFile Find and Replace Text Aid Kit Office Edition.  It definitely isn't free.  Web site blocked by Malwarebytes, but they tend to false positives.  I used an old edition of HFFR years ago for other purposes.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #13 on: January 26, 2021, 03:01 PM »
Try HandyFile Find and Replace Text Aid Kit Office Edition.  It definitely isn't free.  Web site blocked by Malwarebytes, but they tend to false positives.  I used an old edition of HFFR years ago for other purposes.
I have visited this webpage. https://silveragesoftware.com/index.php

and some links goes to https://play.google....=6944889935549986731

There are error in the webpage and don't go.
 :-[

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #14 on: January 26, 2021, 03:03 PM »
Another strange web page is https://www.binaryma...download?ref=gallery
When you try the program observe strange things.
 :-\

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,506
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #15 on: January 26, 2021, 06:49 PM »
I am doing something wrong.
No replaces at all.

That's because it looks for *.docx files by default, you need to change it to *.doc.
Changing it to *.doc? would probably do both types but I haven't tested it.

Code: Text [Select]
  1. strFile = Dir(strFolder & "\" & "*.doc", vbNormal)
or
Code: Text [Select]
  1. strFile = Dir(strFolder & "\" & "*.doc?", vbNormal)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #16 on: January 27, 2021, 04:09 AM »
I am doing something wrong.
No replaces at all.

That's because it looks for *.docx files by default, you need to change it to *.doc.
Changing it to *.doc? would probably do both types but I haven't tested it.

Code: Text [Select]
  1. strFile = Dir(strFolder & "\" & "*.doc", vbNormal)
or
Code: Text [Select]
  1. strFile = Dir(strFolder & "\" & "*.doc?", vbNormal)
:tellme: :tellme: :tellme: ;D

I'll try and comment.

By the way I have tried the old VBA Find And Replace https://gregmaxey.co...ind_and_replace.html
But only goes well for me the option with a single phrase and replace in an opened document

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #17 on: January 27, 2021, 06:43 AM »
RESULTS

The script only works in the folder selected. Not in its subfolders. . I suppose this is perfectly correct. The script opens file by file doing the replaces and many of my files hace codes and fields to be updated. But goes well anyway. Obviously this limits because I think is not good maintain opened a huge amount of files in replace action waiting for my decision.... Below a window that appear in almost any of my word files.

AsusPortatil - 27_01_2021 , 12_37_24.pngBatch Word Text Replacer

I usually doc format in general. Recently I observ that I even can save as a docx file and allow me to make the fusion/combination of fields from Goldmine 5.5 (a CRM I use many years ago, a legacy version) . In the experiment after modify the script only find and replace in the doc files, not in the docx files.
So a possible modification of the script is the ability to process doc and docx files.

 :-* :P

Note : sorry I need a new glasses. I will try doc? and comment .
 :tellme:

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #18 on: January 27, 2021, 10:25 AM »
Goes well  ;D !!!!!!!!!

All may be better, but for now is enough for me. Perhaps an implementation to examine an entire folder and its subfolders but taking care not to open a huge amount of files to not collapse the system.
 :-* :P

P.D. In the post multi find and replace in a document I have something to please for ....
https://www.donation...?topic=51006.new#new

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 198
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #19 on: January 28, 2021, 02:46 AM »
Just a note: Office 2010 is not supported anymore by Microsoft, in the same way that Windows 7 isn't supported anymore.[…]
Yeah, it's supposed to be end of life since october of 2020, but they still published patches for it this month (for example KB4493145). Maybe someone over there forgot about it? :D

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 10,902
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #20 on: January 28, 2021, 07:04 AM »
Just a note: Office 2010 is not supported anymore by Microsoft, in the same way that Windows 7 isn't supported anymore.[…]
Yeah, it's supposed to be end of life since october of 2020, but they still published patches for it this month (for example KB4493145). Maybe someone over there forgot about it? :D

If it's a critical patch, they still publish them a while after, I've found.

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 628
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #21 on: February 18, 2021, 06:24 AM »
When I do have some more free time left, I might be able to program an OLE/COM based word text-search&replace mechanism.
(It would need to have original Microsoft Word [or Office with Word] installed to do it's job)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,665
    • View Profile
    • Donate to Member
Re: Batch Word Text Replacer
« Reply #22 on: February 23, 2021, 04:16 AM »
When I do have some more free time left, I might be able to program an OLE/COM based word text-search&replace mechanism.
(It would need to have original Microsoft Word [or Office with Word] installed to do it's job)
Perfect. It's a good alternative.
Best Regards
 :-* :P