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:
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
- 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.
- Secondly, right click on the document icon and choose “Rename” on the menu.
- Thirdly, change the extension “.docx” to “.zip”.
- You will encounter with the warning message, and just click “Yes”.
- After the document converting to a zip file, double click to open it.
- Now double click to open “word” folder.
- Then double click to open “embeddings” folder. You can find all files there but without identifiable. The mess is you have to rename them.
Method 2: Run Word Macro
- 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.
- Next click “Normal” project.
- Then click “Insert” tab.
- Choose “Module” on the drop-down menu.
- Now double click on the new module to have the coding space.
- 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
- Finally, click “Run” button or hit “F5”.
All embedded files will be stored under a specific directory with their original 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