2 Quick Ways to Extract the MS Office Files Embedded in Your Word Document

In today’s article, we will provide you with 2 quick ways to extract all the MS office files embedded in your Word document.

Every so often, we could inherit a Word document containing multiple embedded files, such as below:Word Document with Embedded Files

Normally, to export them, we will have to open the file and then save it. This way, however, is acceptable when there are few files. Once a large number of objects are involved, we shall look for some more quick and energy-saving shortcuts. For this reason, we have the following 2 methods ready for you.

Method 1: Change the File Extension

  1. First off, before anything else, we recommend you to make a copy of the target file, in case any incidents may cause damage to it.
  2. Secondly, right click on the document icon and choose “Rename” on the menu.
  3. Thirdly, change the extension “.docx” to “.zip”.
  4. You will encounter with the warning message, and just click “Yes”.Click "Yes" to Change File Extension
  5. After the document converting to a zip file, double click to open it.
  6. Now double click to open “word” folder.
  7. Then double click to open “embeddings” folder. You can find all files there but without identifiable. The mess is you have to rename them.Extract Embedded Files without Identifiable Names

Method 2: Run Word Macro

  1. First and foremost, click on “Developer” tab and then the “Visual Basic”. Or just press “Alt+ F11” instead if the “Developer” tab isn’t available.Click "Developer"->Click "Visual Basic"
  2. Next click “Normal” project.
  3. Then click “Insert” tab.
  4. Choose “Module” on the drop-down menu.Click "Normal"->Click "Insert"->Click "Module"
  5. Now double click on the new module to have the coding space.
  6. And paste the bellowing codes there:
Sub ExtractAndSaveEmbeddedFiles()
  Dim objEmbeddedShape As InlineShape
  Dim strShapeType As String, strEmbeddedDocName As String
  Dim objEmbeddedDoc As Object
 
  With ActiveDocument
  For Each objEmbeddedShape In .InlineShapes
 
  '  Find and open the embedded doc.
  strShapeType = objEmbeddedShape.OLEFormat.ClassType
  objEmbeddedShape.OLEFormat.Open
 
  '  Initialization
  Set objEmbeddedDoc = objEmbeddedShape.OLEFormat.Object
 
  '  Save embedded files with names as same as those of icon label. 
  strEmbeddedDocName = objEmbeddedShape.OLEFormat.IconLabel
  objEmbeddedDoc.SaveAs "C:\Users\Public\Documents\New folder\" & strEmbeddedDocName
  objEmbeddedDoc.Close
 
  Set objEmbeddedDoc = Nothing
 
  Next objEmbeddedShape
  End With
End Sub
  1. Finally, click “Run” button or hit “F5”.Paste Codes->Click "Run"

All embedded files will be stored under a specific directory with their original names.Files with Identifiable Names

Note:

In code line “objEmbeddedDoc.SaveAs “C:\Users\Public\Documents\New folder\” & strEmbeddedDocName”, the “C:\Users\Public\Documents\New folder\” is the location for storing files. Remember to replace it with an actual one.

Take Care of Word Files

Since some of you work with Word very frequently, then confronting with a corrupted Word can be commonplace. Therefore, that’s why we lay much emphasis on well handling files. After all, once a file gets damaged, it takes both time and money to bring it back to life.

Author Introduction:

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

Comments are closed.