3 Ways to Batch Change Text Format in All Text Boxes in Word Document

In this article bellow, we want to show you 3 ways to batch change text format in all text boxes in your Word document.

Text boxes are often seen in out documents. While format document texts, we cannot forget those in text boxes. However, text boxes scattering in a document can make you hard to select all texts inside once and for all. Therefore, out of formatting purposes, it’s urgent to learn some trick to do the batch processing.Batch Change Text Format in All Text Boxes

Method 1: Utilize “Advanced Find” Feature

  1. First of all, click “Home” tab and go to click the arrow button behind “Find” command in “Editing” group.
  2. Next on the drop-down list, choose “Advanced Find” to open the “Find and Replace” dialog box.Click "Home"->Click the arrow button behind "Find"->Choose "Advanced Find"
  3. Put cursor at “Find what” text box and enter “^?” there.
  4. Then click “Find In” button and choose “Text Boxes in Main Document”.Enter in "Find what" Text Box->Click "Find In"->Click "Text Boxes in Main Document"
  5. Now you can see all texts in text boxes are in selection. In case you may forget the string to be put in “Find what” box, you can click “More” button to open more options in the box and then click “Special”. Next choose “Any Character”.Click "Special"->Click "Any Character"
  6. With all texts in selection, just format them as required.

Method 2: Batch Change Text Format in All Text Boxes in One Document

  1. To start off, press “Alt+ F11” in Word to trigger VBA editor.
  2. Next click “Normal”.
  3. Then click “Insert” tab and choose “Module”.Click "Normal"->Click "Insert"->Click "Module"
  4. And double click the new module and paste the bellowing macro there:
Sub FormatTextsInTextBoxes()
  Dim objShape As Shape
  Dim objDoc As Document
 
  Set objDoc = ActiveDocument
 
  With objDoc
    For Each objShape In .Shapes
      If objShape.Type = msoTextBox Then
        objShape.TextFrame.TextRange.Font.Name = "Arial"
        objShape.TextFrame.TextRange.Font.Size = "16"
      End If
    Next
  End With
End Sub
  1. Finally, click “Run”.Paste Macro->Click "Run"

This macro sets all text box texts in “Arial” font at 16 pt. You may alter these setting as need.

Method 3: Batch Change Text Format in All Text Boxes in Multiple Documents

Now that we are talking about batch processing, we cannot eliminate the need to do it among multiple files.

  1. Firstly, arrange all target documents under the same directory.
  2. Next install and run macro as you do in method 2. This time replace those codes with the following ones:
Sub FormatTextsInTextBoxesInMultiDoc()
  Dim strFile As String
  Dim strFolder As String
  Dim objDoc As Document
 
  '  Initialization
  strFolder = InputBox("Enter folder path here: ")
  strFile = Dir(strFolder & "*.docx", vbNormal)
 
  '  Process each file in the folder.
  While strFile <> ""
    Set objDoc = Documents.Open(FileName:=strFolder & strFile)
    Set objDoc = ActiveDocument
 
    With objDoc
      For Each objShape In .Shapes
        If objShape.Type = msoTextBox Then
          objShape.TextFrame.TextRange.Font.Name = "Arial"
          objShape.TextFrame.TextRange.Font.Size = "16"
        End If
      Next
    End With
    objDoc.Save
    objDoc.Close
    strFile = Dir()
  Wend
End Sub
  1. While running the macro, there will be an input box prompting up, such as bellow:Enter Folder Address->Click "OK"
  2. Enter the folder address at the text box and click “OK”. Don’t forget to add a “\” at the end of your path string. Then just wait Word to do its job.

Make Full Preparation while You Can

We understand it’s hard to even think about your file getting corrupt. However, we can never overlook this possibility which, to be honest, is relative high. Anyway, it’s less troublesome to take preventive measures than hopping around for a doc fix tool.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including fix Excel and pdf repair software products. For more information visit www.datanumen.com

Leave a Reply

Your email address will not be published. Required fields are marked *