{"id":539,"date":"2011-12-23T23:49:18","date_gmt":"2011-12-23T15:49:18","guid":{"rendered":"http:\/\/www.hsyyf.me\/?p=539"},"modified":"2012-04-08T02:05:07","modified_gmt":"2012-04-07T18:05:07","slug":"%e6%8f%90%e5%8f%96word%e3%80%81excel%e9%87%8c%e7%9a%84flash%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.hsyyf.me\/?p=539","title":{"rendered":"\u63d0\u53d6Word\u3001Excel\u91cc\u7684flash\u6587\u4ef6"},"content":{"rendered":"<p>\u6253\u5f00\u4e00\u4e2aExcel\uff0c\u5728\u89c6\u56fe\u9875\u9762\u521b\u5efa\u4e00\u4e2a\u5b8f\u5982\u4e0b<br \/>\n<code>Sub aa()<br \/>\nDim tmpFileName As String, FileNumber As Integer<br \/>\nDim myFileId As Long<br \/>\nDim myArr() As Byte<br \/>\nDim i As Long<br \/>\nDim MyFileLen As Long, myIndex As Long<br \/>\nDim swfFileLen As Long<br \/>\nDim swfArr() As Byte<\/p>\n<p>tmpFileName = Application.GetOpenFilename(\"office File(*.doc;*.xls),*.doc;*.xls\", , \"\u8bf7\u9009\u62e9\u4e00\u4e2a\u5305\u542bFlash\u7684Office\u6587\u6863\")<\/p>\n<p>If tmpFileName = \"False\" Then Exit Sub<\/p>\n<p>myFileId = FreeFile<\/p>\n<p>Open tmpFileName For Binary As #myFileId<\/p>\n<p>MyFileLen = LOF(myFileId)<\/p>\n<p>ReDim myArr(MyFileLen - 1)<br \/>\nGet myFileId, , myArr()<br \/>\nClose myFileId<\/p>\n<p>Application.ScreenUpdating = False<\/p>\n<p>i = 0<\/p>\n<p>Do While i &lt; MyFileLen<\/p>\n<p>If myArr(i) = &amp;H46 Then<\/p>\n<p>If myArr(i + 1) = &amp;H57 And myArr(i + 2) = &amp;H53 Then<\/p>\n<p>swfFileLen = CLng(&amp;H1000000) * myArr(i + 7) + CLng(&amp;H10000) * myArr(i + 6) + CLng(&amp;H100) * myArr(i + 5) + myArr(i + 4)<\/p>\n<p>ReDim swfArr(swfFileLen - 1)<\/p>\n<p>For myIndex = 0 To swfFileLen - 1<\/p>\n<p>swfArr(myIndex) = myArr(i + myIndex)<\/p>\n<p>Next myIndex<br \/>\nExit Do<br \/>\nElse<br \/>\ni = i + 3<br \/>\nEnd If<br \/>\nElse<br \/>\ni = i + 1<br \/>\nEnd If<br \/>\nLoop<\/p>\n<p>myFileId = FreeFile<\/p>\n<p>tmpFileName = Left(tmpFileName, Len(tmpFileName) - 4) &amp; \".swf\"<\/p>\n<p>Open tmpFileName For Binary As #myFileId<\/p>\n<p>Put #myFileId, , swfArr<\/p>\n<p>Close myFileId<br \/>\nMsgBox \"\u4ee5\" &amp; tmpFileName &amp; \"\u540d\u5b57\u4fdd\u5b58\"<br \/>\nEnd Sub<\/code><br \/>\nF5\u8fd0\u884c\u5b8f\uff0c\u9009\u62e9\u6587\u4ef6\uff0c\u5373\u53ef\u5728\u6587\u4ef6\u5f53\u524d\u76ee\u5f55\u4fdd\u5b58swf\u6587\u4ef6<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6253\u5f00\u4e00\u4e2aExcel\uff0c\u5728\u89c6\u56fe\u9875\u9762\u521b\u5efa\u4e00\u4e2a\u5b8f\u5982\u4e0b Sub aa() Dim tmpFileName As Stri [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[3],"tags":[94,17],"class_list":["post-539","post","type-post","status-publish","format-standard","hentry","category-3","tag-excel","tag-flash"],"_links":{"self":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/posts\/539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=539"}],"version-history":[{"count":0,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=\/wp\/v2\/posts\/539\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hsyyf.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}