2 Ways to Quickly Get the Alternative Texts of Pictures, Shapes, Tables, Charts, SmartArt Graphics, or Other Objects

In this article, we will exhibit you 2 ways to quickly get the alternative texts of pictures, shapes, Tables, charts, SmartArt graphics, or other objects in Word document.Get the Alternative Texts of Pictures, Shapes, Tables, Charts, SmartArt Graphics, or Other Objects

Sometimes, objects like shapes, pictures inserted into your document contain alternative texts. They help to explain the details of an object. However, these texts do not show themselves directly. Instead, you have to right click on an object. And choose “Format Object” to open “Format Shape” box. Next click “Alt Text” in order to see such information as “Title” and “Description”.Click "Alt Text"

This is cumbersome and not intuitionistic enough. Therefore, we’d like to offer you 2 quicker methods to see or insert the alternative texts of objects in document.

Method 1: See the Alternative Texts of all Objects

For your reference, we tend to do it in macro way.

  1. First if all, press “Alt+ F11” in Word to trigger VBA editor.
  2. Next create a new module in “Normal” project. To do so, click “Normal”.
  3. Then click “Insert” tab and choose “Module” on its drop-down menu.Click "Normal"->Click "Insert"->Click "Module"
  4. Double click on the new module to open the editing space on the right side.
  5. Paste the following codes there:
Sub ShowAltText() 
  Dim objDoc As Document
  Dim objShape As Object
 
  Set objDoc = ActiveDocument
 
  With objDoc
    For Each objShape In .Shapes
      If objShape.AlternativeText <> "" Then
        MsgBox ("Title: " & objShape.Title & vbNewLine & "Description:" & vbNewLine & objShape.AlternativeText)
      Else
        MsgBox ("There is no Alt Text.")
      End If
    Next
 
    For Each objShape In .InlineShapes
      If objShape.AlternativeText <> "" Then
        MsgBox ("Title: " & objShape.Title & vbNewLine & "Description:" & vbNewLine & objShape.AlternativeText)
      Else
        MsgBox ("There is no Alt Text.")
      End If
    Next
 
    For Each objShape In .Tables
      If objShape.Descr <> "" Then
        MsgBox ("Title: " & objShape.Title & vbNewLine & "Description:" & vbNewLine & objShape.Descr)
      Else
        MsgBox ("There is no Alt Text.")
      End If
    Next
  End With
End Sub
  1. Last but not the least, click “Run” button.Paste Macro->Click "Run"

You shall see message box popping up one after another. You will get the alternative text of each object in your document.

Here is an example:Message Box Showing Detailed Alternative Text

Method 2: Insert the Alternative Text into Document

Now there is another case that is to extract and insert the alternative text of an object into document via VBA. This way, the alternative texts work very much like the “Caption” for figures and tables.

Here is how we do it:

  1. Firstly, follow the exact steps in method 1 to install and run a macro.
  2. Secondly, paste this macro:
Sub ShowAltTextBelowPic()
  Dim objDoc As Document
  Dim objShape As Object
 
  Set objDoc = ActiveDocument
 
  With objDoc
    For Each objShape In .Shapes
      objShape.ConvertToInlineShape
    Next
 
    For Each objShape In .InlineShapes
      objShape.Range.InsertAfter vbNewLine & objShape.Title & vbNewLine & objShape.AlternativeText
    Next
 
    For Each objShape In .Tables
      objShape.Select
      Selection.Collapse wdCollapseEnd
      Selection.InsertAfter vbNewLine & objShape.Title & vbNewLine & objShape.Descr
    Next
 
  End With
End Sub

Check the result:Alternative Texts

Handle Instances of Corrupted Documents

Have you ever run across a damaged docx? If true, you probably understand the feeling of scratching hair and hopping for solutions to visit the inaccessible documents again. Now to save you from such heart-broken situation, we recommend you taking a proficient repairing tool to retrieve lost data.

Author Introduction:

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

Leave a Reply

Your email address will not be published.