PDA

View Full Version : [SOLVED:] replacing text in a set of word 2010 files (Collection, folder..)



Esgrimidor
01-25-2021, 09:36 AM
I would a program tested by you and using for find and replace text inside word 2010 files.
Not producing corrupted files like notepad++ and others.

Best Regards

gmaxey
01-25-2021, 09:45 AM
https://gregmaxey.com/word_tip_pages/vba_find_and_replace.html

macropod
01-25-2021, 01:39 PM
Cross-posted at:
https://www.tek-tips.com/viewthread.cfm?qid=1808206
https://www.msofficeforums.com/word/46391-replace-text-several-word-2010-files-across.html
Replace in a group or selection or collection of word files | Microsoft Office Forums (office-forums.com) (https://www.office-forums.com/threads/replace-in-a-group-or-selection-or-collection-of-word-files.2350952/)
Please read VBA Express' policy on Cross-Posting in Rule 3: http://www.vbaexpress.com/forum/faq.php?faq=new_faq_item#faq_new_faq_item3

Esgrimidor
01-26-2021, 02:52 PM
https://gregmaxey.com/word_tip_pages/vba_find_and_replace.html

Thanks gmaxey .
I am trying with word 2010 spanish version under windows 10
I will comment any doubt.
Best Regards

Esgrimidor
01-26-2021, 03:12 PM
I don't know how to solve or prepare a predefined word list.
Can you give me an example ?

Best Regards

macropod
01-26-2021, 09:47 PM
A forum search wouldn't have gone astray. See, for example:
[SOLVED] Large Scale Find Replace, Loop to all files in folder (vbaexpress.com) (http://www.vbaexpress.com/forum/showthread.php?50225-Large-Scale-Find-Replace-Loop-to-all-files-in-folder&highlight=bulkfindreplace)
http://www.vbaexpress.com/forum/showthread.php?34992-Help-With-VBA-For-A-Large-Search-and-Replace-Operation-Problem-with-MatchWholeWord&p=230215&viewfull=1#post230215 (you might want to combine this with the replacement implementaion in http://www.vbaexpress.com/forum/showthread.php?36744-Macro-to-pick-information-from-notepad&p=239647&viewfull=1#post239647)
http://www.vbaexpress.com/forum/showthread.php?67130-RUNTIME-ERROR-5174&p=400838&viewfull=1#post400838
And, since you cross-posted this at MS Office forums, a search there would have turned up:
Created VBA to Find and Replace in Body, Header and Footer with Highlighting the replacement text (msofficeforums.com) (https://www.msofficeforums.com/word-vba/22669-created-vba-find-replace-body-header-footer.html)
VBA code to run macro across all documents in folder (msofficeforums.com) (https://www.msofficeforums.com/word-vba/38690-vba-code-run-macro-across-all-documents.html)
amongst others...

Esgrimidor
01-27-2021, 03:14 AM
Thanks macropod. I will try when understood.
Best Regards

Esgrimidor
01-27-2021, 10:03 AM
VBA Find and Replace don't go in my system with the option find and replace in a folder.
Only works find and replace a phrase.
I don't know how to do the file with the set of phrases to be found and replaced.


A forum search wouldn't have gone astray. See, for example:
[SOLVED] Large Scale Find Replace, Loop to all files in folder (vbaexpress.com) (http://www.vbaexpress.com/forum/showthread.php?50225-Large-Scale-Find-Replace-Loop-to-all-files-in-folder&highlight=bulkfindreplace)
http://www.vbaexpress.com/forum/showthread.php?34992-Help-With-VBA-For-A-Large-Search-and-Replace-Operation-Problem-with-MatchWholeWord&p=230215&viewfull=1#post230215 (you might want to combine this with the replacement implementaion in http://www.vbaexpress.com/forum/showthread.php?36744-Macro-to-pick-information-from-notepad&p=239647&viewfull=1#post239647)
http://www.vbaexpress.com/forum/showthread.php?67130-RUNTIME-ERROR-5174&p=400838&viewfull=1#post400838
And, since you cross-posted this at MS Office forums, a search there would have turned up:
Created VBA to Find and Replace in Body, Header and Footer with Highlighting the replacement text (msofficeforums.com) (https://www.msofficeforums.com/word-vba/22669-created-vba-find-replace-body-header-footer.html)
VBA code to run macro across all documents in folder (msofficeforums.com) (https://www.msofficeforums.com/word-vba/38690-vba-code-run-macro-across-all-documents.html)
amongst others...


Paul my problem is that i am not a programmer. So I try the more easy way for me. I don't try to learn VBA beyond insertion of the code or little modifications.
I am trying with success now these codes :

https://www.datanumen.com/blogs/find-replace-multiple-items-word-document/

and other for find and replace files in a folder, but not its subfolders like may do greg utility.

Best Regards

I have seen one of the link you provided.
The table of substitutions seems a word table of two columns with the extension docx

table.docx



I will try this and comment. But seems to me I am doing something wrong with greg maxey utility because in the folder and subfolder optiones there is not interaction at all.

macropod
01-27-2021, 04:14 PM
We can't see what you're doing. We can point you to proven solutions - for which you don't have to be a programmer - but it's up to you to implement them, following the clear instructions given in the links you've been provided. Choose the one approach that best meets your needs and stick with it; don't try to cobble together something from parts of the different solutions.

Esgrimidor
01-30-2021, 04:45 AM
Follow here
https://www.msofficeforums.com/word/46391-replace-text-several-word-2010-files-across.html#post157240

I will try now inhabilitate a window appear in many of my doc files :

http://imagizer.imageshack.com/img924/3216/Y1Veju.png