J
Jason Morin
Hello. I use the following code to generate a text file that lists all
embedded OLE objects in a doc. How do I find the page number where each OLE
object is embedded? Thanks.
********
Sub ListFiles()
Dim shape As InlineShape
Dim sFile As String
Dim nFileNum As Long
Dim sWarning As String
sWarning = "Note: If you are using Word 97 of 2000, " & _
"this macro will not work on files created in Word " & _
"2003 or later!"
MsgBox sWarning, vbExclamation
nFileNum = FreeFile
Open "Embedded_Files.txt " For Output As #nFileNum
For Each shape In ThisDocument.InlineShapes
If shape.Type = wdInlineShapeEmbeddedOLEObject Then
sFile = shape.OLEFormat.IconLabel
Print #nFileNum, sFile
sFile = Empty
End If
Next shape
Print #nFileNum, "---------------"
Print #nFileNum, "Total Files: " & ThisDocument.InlineShapes.Count
Close #nFileNum
End Sub
embedded OLE objects in a doc. How do I find the page number where each OLE
object is embedded? Thanks.
********
Sub ListFiles()
Dim shape As InlineShape
Dim sFile As String
Dim nFileNum As Long
Dim sWarning As String
sWarning = "Note: If you are using Word 97 of 2000, " & _
"this macro will not work on files created in Word " & _
"2003 or later!"
MsgBox sWarning, vbExclamation
nFileNum = FreeFile
Open "Embedded_Files.txt " For Output As #nFileNum
For Each shape In ThisDocument.InlineShapes
If shape.Type = wdInlineShapeEmbeddedOLEObject Then
sFile = shape.OLEFormat.IconLabel
Print #nFileNum, sFile
sFile = Empty
End If
Next shape
Print #nFileNum, "---------------"
Print #nFileNum, "Total Files: " & ThisDocument.InlineShapes.Count
Close #nFileNum
End Sub