Private Sub CommandButton1_Click()
'測試環境
'Adobe Reader X 開檔版本10.1.0.534
'or Adobe Reader 9
Dim tim!
tim = Timer
[K1] = ""
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Mypath = ThisWorkbook.Path '讀取目前路徑
ChDir Mypath
Myfile = Dir("*.pdf")
Do While Myfile <> ""
Set WSh = CreateObject("WScript.Shell")
WSh.Run Myfile '開啟 pdf 檔案
Application.Wait (Now + TimeValue("0:00:1"))
'暫停1秒(等候開啟檔案看檔案大小電腦執行快慢適度增加)
SendKeys "%E" '按Alt+E鍵[編輯]
SendKeys "L" '按L鍵 [全選]
Application.Wait (Now + TimeValue("0:00:1"))
SendKeys "%E" '按Alt+E鍵[編輯]
Application.Wait (Now + TimeValue("0:00:1"))
SendKeys "C" '按 C 鍵 [複製]
Application.Wait (Now + TimeValue("0:00:1"))
SendKeys "%F" '按Alt+F鍵[檔案]
SendKeys "x" '按 x 鍵 [離開]
Application.Wait (Now + TimeValue("0:00:1")) '等候關檔
Myfile = Dir
Cells(n * 75 + 1, 1).Select '選取要貼上的儲存格
ActiveSheet.Paste '貼上
n = n + 1
Loop
Range("A1").Select
[K1] = Format((Timer - tim) / 24 / 60 / 60, "hh:mm:ss")
End Sub
引用自: http://tw.knowledge.yahoo.com/question/question?qid=1012042005823行銷軟體開發租售廣告行銷軟體中時日記回應貼文軟體關鍵字自然排序點擊軟體
留言列表