如何取出ppt中的flash
新建一个excel文档,在“开发工具”选项卡下面单击“vb”按钮,进入编程状态,单击“插入”菜单下的“模块”命令,在弹出的窗口中粘贴下面代码:
Sub ExtractFlash()
Dim tmpFileName As String, FileNumber As Integer
Dim myFileId As Long Dim myArr() As Byte Dim i As Long
Dim MyFileLen As Long, myIndex As Long
Dim swfFileLen As Long Dim swfArr() As Byte
tmpFileName = Application.GetOpenFilename("office File(*.doc;*.xls),*.doc;*.xls", , "
确定要分析的 Office 档") If tmpFileName = "False" Then Exit Sub
myFileId = FreeFile
Open tmpFileName For Binary As #myFileId
MyFileLen = LOF(myFileId) ReDim myArr(MyFileLen - 1)
Get myFileId, , myArr()
Close myFileId
Application.ScreenUpdating = False
i = 0
Do While i < MyFileLen
If myArr(i) = &H46 Then
If myArr(i + 1) = &H57 And myArr(i + 2) = &H53 Then
swfFileLen = CLng(&H1000000) * myArr(i + 7) + CLng(&H10000) * myArr(i + 6) +
CLng(&H100) * myArr(i + 5) + myArr(i + 4)
ReDim swfArr(swfFileLen - 1)
For myIndex = 0 To swfFileLen - 1
swfArr(myIndex) = myArr(i + myIndex)
Next myIndex
Exit Do
Else i = i + 3
End If Else
i = i + 1
End If
Loop
myFileId = FreeFile
tmpFileName = Left(tmpFileName, Len(tmpFileName) - 4) & ".swf"
Open tmpFileName For Binary As #myFileId
Put #myFileId, , swfArr
Close myFileId
MsgBox "以" & tmpFileName & "名字保存"
End Sub
粘贴好了以后返回到excel主界面,把该excel文档起一个你容易辨识的名字,保存为“启用宏的工作簿”,留着用来提取
swf文件。
打开嵌入了swf文件的ppt,在swf文件上右键单击,选择复制,新建一个excel文件,在新建的excel文件里右键“粘贴”,把
ppt里的swf文件复制过来,起个名字,保存为excel 97—2003工作薄(这里面的版本选择很重要,不要选错),保存好了关闭该excel。
打开我们第一个粘贴有代码的excel文档,在“开发工具”下,单击“宏”,弹出宏对话框,单击“执行”,在打开的窗口中选择粘贴有swf文件的excel文件,大功告成,里面的swf马上就会被提取出来。