Extract an embedded SWF file from a Microsoft Excel or Word file
Thanks for visiting my site lucky visitor:
This page was last updated on: May 27, 2007
Copyright © 2002. XcelFiles. All Rights Reserved Ivan F Moala
Some time ago I came upon this thread by EMILY, who I have come to know via her posts, which I usually find interesting.
Ok, so what is a SWF file, you have seen these on other sites .... have a look here
When I first looked, I got the file (SWF) data via an amendment done to this file. This file was an addin that dumped an animated gif data into an Excel sheet ready to be processed for displaying. I have NOT made this file available!
Any way, here is the data dump.
Here is an Example workbook.
This page was created 27th April 2007







The relevant data bytes are the first 8 bytes;
- First 4 are the signature, the last being the version of the SWF file. In the above example it is 5.
- The next 4 bytes is the length of the file in Little-Endian format, as you would expect for Intel processors - those used in PC's. So the length increments up to a base 2 to the power 0f 8. See above 191 X 2 to the power of 0 (1), 116 X 2 to the power of 8 (256), 2 X 2 to the power of 16 (65536) etc.
Knowing this AND the fact that Excel and Word embed the file as a file stream, it is easy to search for this file and extract it.
Why extract it from the files native data? because you cannot get an embedded SWF file from the control that has this. The control that houses the SWF file can then be moved around with no dependency on a linked SWF file, so once the file is embedded you cannot extract it from the control.
Here is an example file that will extract from an Excel or Word file, the embedded SWF file. The routine will allow you to extract from multiple selected Excel or Word files.