3 Quick Methods to Add Borders to Pictures in Your Word Document

In this article, we would like to discuss 3 quick methods of how to add borders to pictures in your Word Documents.

Why would we apply borders to pictures? The answer is obvious. Some pictures are too much like the main contents, say a shot of a block of words, which we might easily mistake for texts. Therefore, to make pictures stand out the text contents avails the usefulness of the following 3 methods we are going to show you.

Method 1: Add Borders to One Picture in One Document

  1. Firstly, click on a picture to select.
  2. Next click “Format” tab under “Picture Tool”.
  3. Then click “Picture Border” and choose a color.   Select Picture->Click "Format"->Click "Picture Border"->Choose a colorAdding picture borders

Method 2: Add Borders to All Pictures in one Document

As shown in method 1, manually alter picture one by one is really not a great idea. To save efforts, macro is the way you should take.

  1. To start with, click “Developer” tab then the “Visual Basic” to show the VBA editor. When “Developer” is not available, simply press “Alt+ F11” instead.Click "Developer"->Click "Visual Basic"
  2. Then click “Normal”.
  3. Next click “Insert” tab and choose “Module” on its menu.Click "Normal"->Click "Insert"->Click "Module"Click "Normal"->Click "Insert"->Click "Module"
  4. Double click on the new module to open coding area on the right side.
  5. Now paste the bellowing macro there:
Sub AddPictureBorders()
  Dim objShape As Shape
  Dim objInLineShape As InlineShape
  Dim objDoc As Document
 
  Set objDoc = ActiveDocument
 
  With objDoc
    For Each objInLineShape In .InlineShapes
      With objInLineShape.Line
        .Style = msoLineSingle
        .ForeColor.RGB = RGB(0, 0, 0)
      End With
    Next
    For Each objShape In .Shapes
      objShape.Fill.Solid
      With objShape.Line
        .Style = msoLineSingle
        .ForeColor.RGB = RGB(0, 0, 0)
      End With
    Next
  End With
End Sub
  1. Last but not the least, click “Run” button or hit “F5”.Paste Codes->Click "Run"

Method 3: Add Borders to All Pictures in Multiple Documents

Since we can write a macro to deal with pictures in a document, there is way to process pictures in multiple documents as well.

Before all, you need to organize all target documents under the same directory. Then follow the exact the same steps exhibited above to install and run a macro, but replace it with the following one:

Sub AddPictureBordersInMultiDoc()
  Dim objShape As Shape
  Dim objInLineShape As InlineShape
  Dim objDoc As Document
  Dim strFile As String
  Dim strFolder As String
 
  Set objDoc = ActiveDocument
  strFolder = "C:\Users\Public\Documents\New folder\"
  strFile = Dir(strFolder & "*.docx", vbNormal)
 
  While strFile <> ""
    Set objDoc = Documents.Open(FileName:=strFolder & strFile)
    With objDoc
      For Each objInLineShape In .InlineShapes
        With objInLineShape.Line
          .Style = msoLineSingle
          .ForeColor.RGB = RGB(0, 0, 0)
        End With
      Next
      For Each objShape In .Shapes
        objShape.Fill.Solid
        With objShape.Line
          .Style = msoLineSingle
          .ForeColor.RGB = RGB(0, 0, 0)
        End With
      Next
    End With
    objDoc.Save
    objDoc.Close
    strFile = Dir()
  Wend
End Sub

Notes:

  1. The “C:\Users\Public\Documents\New folder\” in this macro refers to the directory path where you store documents. And never forget to add the last “\”.
  2. You can change the border color by altering the RGB value.

Time to Think about Backup

Most of us have been well informed of what a backup can do. It can be your life saver at the times of having Word damage. Thus, we shall never undermine the effect of taking minutes to back up valuable documents. As such, one cannot guarantee the safety of his data.

Author Introduction:

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

Comments are closed.