VBA Express Forum  
Google
 




Go Back   VBA Express Forum > VBA Code & Other Help > Excel Help
     Feedback     
Register FAQ Members Arcade KBase Articles

Reply
 
Thread Tools Display Modes
Old 04-29-2007, 01:38 PM   #1
Emily

 
Joined: Oct 2004
Posts: 159
Kb Entries: 1
Articles: 0
Advice: Extract Embed Flash file in Excel / Word

Here a code found in China Excel forum to extract embedded Flash file in Excel / Word.


VBA:
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", , "Select Excel / Word File") 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 "SaveAs " & tmpFileName End Sub
VBA tags courtesy of www.thecodenet.com

Local Time: 05:26 PM
Local Date: 07-30-2010
Location:

 
Reply With Quote Top
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 05:26 AM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright @2004 - 2009 VBA Express