How to search multiple word documents

broken image

Enter the folder path where you store documents. Set objDoc = Documents.Open(FileName:=strFolder & '\' & strFile) Save and close the file after the action. ' Open each file in the folder to search and replace texts. StrReplaceText = InputBox('Enter replacing text here:') StrFindText = InputBox('Enter finding text here:') StrFile = Dir(strFolder & '\' & '*.docx', vbNormal) StrFolder = InputBox('Enter folder path here:')

broken image

' Pop up input boxes for user to enter folder path, the finding and replacing texts. Now you’ve successfully inserted a new module.Next click “Insert” tab and then choose “Module”.Or simply press “Alt+ F11” to trigger the VBA editor. First and foremost, put all file in one folder and open Word.Since there is always the need to search and replace contents in a batch of files, it would be nice to have the function realized. Then have you thought about using this option in multi-document, like all files under a specific folder? It helps us with the batch process through the entire document, which saves us a lot of time. Generally speaking, most Word users are quite familiar with the “Find and Replace” feature in the software.

broken image

In today’s article, we are thrilled to inform you of the way to find and replace contents in multiple Word documents.