I'm using a script (that I didn't write) to convert Word docs to XML. Everything works perfectly as long as the Word doc is consistently styled. One of the things that the script can't handle is when images are inserted as OLE objects. These images are simply ignored by the script, whereas images that were inserted regularly, as non-OLE objects, are picked up by the script just fine.
I've also been using a VBA script (see part of it below) to clean up the document prior to transforming it. The script adds styles to the document, moves some things, and...what I'm trying to make it do is convert OLE images to non-OLE images.
So what I want to know is: is there a way to iterate through the inlineShapes in the document and convert OLE graphics to regular graphics or, is there a way to get the image data out of the OLE object and paste it into the document as a PNG.
This is what my vba script does right now:
Sub docscrubber()
Dim i As Integer
Dim total As Integer
Dim oIshp As InlineShape
total = ActiveDocument.InlineShapes.Count
i = 0
For Each oIshp In ActiveDocument.InlineShapes
i = i + 1
On Error Resume Next
Application.StatusBar = "Progress: " & i & " of " & total
With oIshp
oIshp.Range.Copy
oIshp.Select
Selection.Paste
End With
Next oIshp
End Sub
Instead of getting the image data, I get the document code.
Thanks in advance!