How to modify the contents of the document in bulk

  
A set of manuscripts has been revised in the near future. According to the editor's requirements, some of the terms involved in the document need to be normalized. For example, “Microsoft” is uniformly modified to “Microsoft” and “Google” is modified to “ldquo;” Google”, there are many terms like this. If you look up or replace them one by one, although you can implement the requirements for modification, the workload can be imagined. In fact, we can use the VBA code, combined with the Excel data list to achieve batch modification requirements. 1. Create a data list. For convenience, we can first create a data list under the Excel worksheet, set the “Before Modification” and “Modify” columns, and the words that need to be modified in batches are in two columns. Input, the effect is shown in Figure 1, the workbook file is saved in the same path as the Word document to be modified. 2. Insert the module code to open the Word document that needs to be modified. Press the “Alt+F11” key combination to open the Microsoft Visual Basic for Applications window, select “Insert → Module”, and insert a blank in the right pane. Module, manually input or paste the following code (code file download address: http://pan.baidu.com/s/1qWPhZ1U) as shown in Figure 2, the macro name in the above code "modification" can be arbitrarily set, please Note the information of the data list.xlsx”, if the file is not in the same path as the Word document, or the file name is different, please modify it according to the actual situation. If the code is checked, you can select “File → Close and return to Microsoft Word", or press “Alt+Q” to return to the Word interface, press “Alt+F8” “ Macro & rdquo; dialog box, as shown in Figure 3, click the "Run" button on the right, wait a moment, you can refer to the words listed in the data list to bulk modify the Word document. Tip: The value of this technique is that if you want to repeat a lot of work like the above requirements (such as editing a large number of articles or data collation), just modify the contents of the data list.xlsx” workbook file, run the VBA code, Is it convenient to make batch edits to other Word documents? This article comes from [System Home] www.xp85.com
Copyright © Windows knowledge All Rights Reserved