
[Home] [EISA .cfg Archive] [Chip set Encyclopedia]
Please note: this site has moved from
http://108.59.254.117/~mR_Slug/ to
http://66.113.161.23/~mR_Slug/. Please update any bookmarks.
Extracting .wmf (Microsoft Draw Objects) from .doc (Word Documents)I had a few thousand .doc files that contained drawings of motherboards in Microsoft Draw format. There isn't a save as... option in Microsoft Word for these drawings. There is however one in Microsoft PowerPoint (Tested in Office XP). You can save the drawings in .WMF format. This is an old format that ClipArt are stored as. This works for a few files but I needed a batch conversion program. There are a few programs to extract images out of .doc files but none worked for me. I did have some experience with extracting data from windows .hlp (WinHelp) files with a program called HelpDeco. By chance i had extracted some .hlp files that contained .wmfs. Nice thing about this program is that it just dumps all the .wmf files from the .hlp. Problem was I had .doc not .hlp. So the plan was; .doc to .hlp to .wmf. Which lead me into the wonderful world of WinHelp compilation/creation. Today there is just enough info left on the web, to find all that you need. But I was unable to get everything to work under Windows 7, I had to use XP. First the process:
.doc to .rtfI tried a few programs but the only one i found to work was a program called 'Batch DOC TO RTF Converter' from Batchwork Software. This is a windows GUI program that claims to work as a command line program. I was unable to get it to work this way, perhaps it requires you to register it. Another problem with the trial version is that it skips some files. This can be solved by just running the batch conversion process twice. (It randomly misses files, but running it twice seemed to work for all files in my case.) It works, but it's not free, and the trial version is imperfect. YMMV. .rtf to .wmfThe two remaining programs are Microsoft Help Workshop (Download) and HelpDeco (Website). Microsoft Help Workshop contains a program called hcrtf.exe it can be called as follows: hcrtf -o temp.hlp /xr filename.rtfHelpDeco.exe can be called as follows: helpdeco temp.hlpSo this allows us to make a simple batch script: convert.bat: set fname=%1 ..\hcrtf -o temp.hlp /xr "%fname%" ..\helpdeco temp.hlp del temp.hlp del temp.hpj del temp.rtf rename bm0.WMF "%fname%-1.WMF"I've included the relevant files at the end. Just place HelpDeco.exe in the same directory as hcrtf.exe. In the 'batch' dir place a .rtf file and call convert.bat as follows: convert filename.rtfIt will pull out all the .WMF images and rename the first 10 to 'filename.rtf-1.WMF', 'filename.rtf-2.WMF'... Alternatively just run run.bat, that will call convert.bat for each .rtf file in the 'batch' directory. If you have more than 10 separate drawings in a single .rtf, you can expand convert.bat, or write a better version that handles any number of drawings. Download
|

(c) Copyright mR_Slug - All rights reserved