View Single Post
  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Bulk Extract Embedded Files

Exactly what is it that you have in the document? That macro is
specifically for in-line shapes.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"DeanH" wrote in message
...
Doug, thanks for the input. The macro does not fail now, but it also does
not
do the extraction.
I have done several tests with several different files, in different
locations, but no extraction happens :-(

DeanH


"Doug Robbins - Word MVP" wrote:

Probably caused by line breaks inserted by the mail program.

Try

For Each shape In ThisDocument.InlineShapes
If shape.Type = wdInlineShapeEmbeddedOLEObject And _
InStr(LCase(shape.OLEFormat.IconLabel), ".doc") 0 Then
shape.OLEFormat.Object.SaveAs (folderName & "\" & _
shape.OLEFormat.IconLabel)
End If
Next shape


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"DeanH" wrote in message
...
Brian, thanks but sorry, it fails at the "End If".
"Compile error: End If without block If"

DeanH


"Brian" wrote:

Found the following for extracting embedded word files. Haven't tried
it
though.

Sub ExtractFiles()
'
' ExtractFiles Macro
'
'
Dim shape As InlineShape
Dim folderName As String
Dim a As Document

folderName = Replace(ThisDocument.Name, ".", "_")
MkDir folderName

For Each shape In ThisDocument.InlineShapes
If (shape.Type = wdInlineShapeEmbeddedOLEObject) And
(InStr(LCase(shape.OLEFormat.IconLabel), ".doc") 0) Then
shape.OLEFormat.Object.SaveAs (folderName & "\" &
shape.OLEFormat.IconLabel)
End If
Next shape

End Sub

Hope it helps.
--
Brian McCaffery


"DeanH" wrote:

Word 2003 on XP
Is there a way to extract embedded files all in one go?
Like the image file extraction process described in
http://www.gmayor.com/extract_images_from_word.htm but for embedded
files?
Many thanks
DeanH