我们遇到了一个Word文件内嵌入了PPT在苹果电脑无法打开,提示错误“ the program used to create this object is powerpoint that program is not installed on your computer”
目录
Microsoft Answer 微软的意思是好像macOS上不支持这类型嵌入,那么如果文件比较多,我们如何批量将嵌入文件在Windows电脑提取出来呢?
Sub ExtractAndSaveEmbeddedFiles()
Dim objEmbeddedShape As InlineShape
Dim strShapeType As String, strEmbeddedDocName As String
Dim objEmbeddedDoc As Object
With ActiveDocument
For Each objEmbeddedShape In .InlineShapes
' Find and open the embedded doc.
strShapeType = objEmbeddedShape.OLEFormat.ClassType
objEmbeddedShape.OLEFormat.Open
' Initialization
Set objEmbeddedDoc = objEmbeddedShape.OLEFormat.Object
' Save embedded files with names as same as those of icon label.
strEmbeddedDocName = objEmbeddedShape.OLEFormat.IconLabel
objEmbeddedDoc.SaveAs "C:\Users\Public\Documents\New folder\" & strEmbeddedDocName
objEmbeddedDoc.Close
Set objEmbeddedDoc = Nothing
Next objEmbeddedShape
End With
End Sub
In code line “objEmbeddedDoc.SaveAs “C:\Users\Public\Documents\New folder\” & strEmbeddedDocName”, the “C:\Users\Public\Documents\New folder\” is the location for storing files. Remember to replace it with an actual one. 例如改为C:\Users\YourUserName\Downloads\filesexport\