ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Batch Word Text Replacer

<< < (4/5) > >>

4wd:
I am doing something wrong.
No replaces at all.
-Contro (January 26, 2021, 10:03 AM)
--- End quote ---

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 ---strFile = Dir(strFolder & "\" & "*.doc", vbNormal)or

--- Code: Text ---strFile = Dir(strFolder & "\" & "*.doc?", vbNormal)

Contro:
I am doing something wrong.
No replaces at all.
-Contro (January 26, 2021, 10:03 AM)
--- End quote ---

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 ---strFile = Dir(strFolder & "\" & "*.doc", vbNormal)or

--- Code: Text ---strFile = Dir(strFolder & "\" & "*.doc?", vbNormal)-4wd (January 26, 2021, 06:49 PM)
--- End quote ---
:tellme: :tellme: :tellme: ;D

I'll try and comment.

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

Contro:
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.

Batch 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:
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.donationcoder.com/forum/index.php?topic=51006.new#new

ConstanceJill:
Just a note: Office 2010 is not supported anymore by Microsoft, in the same way that Windows 7 isn't supported anymore.[…]
-Shades (January 25, 2021, 08:43 PM)
--- End quote ---
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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version