返回列表 上一主題 發帖

pdf另存新檔( 文字檔)可以用vba操作嗎

回復 1# y663258

是開啟 PDF 後,另存為 txt 檔案嗎? 試試SendKey方式
  1. Sub test()

  2.     Set WSh = CreateObject("WScript.Shell")
  3.     WSh.Run "D:\作業\公文\新系統\BrCl029mView4.PDF"      '開啟 pdf 檔案
  4.    
  5.     Application.Wait (Now + TimeValue("0:00:5"))    '暫停5秒(等候開啟檔案)
  6.    
  7.     SendKeys "%F"  '開啟檔案功能選項
  8.    
  9.     Application.Wait (Now + TimeValue("0:00:1"))    '暫停1秒
  10.    
  11.     SendKeys "V"   '存成文字檔
  12.    
  13.     Application.Wait (Now + TimeValue("0:00:1"))    '暫停1秒
  14.    
  15.     SendKeys "D:\作業\公文\新系統\BrCl029mView4.txt"
  16.    
  17.     Application.Wait (Now + TimeValue("0:00:1"))    '暫停1秒
  18.    
  19.     SendKeys "{Enter}"  '按下 Enter 開始存檔(.txt)

  20. End Sub
複製代碼

TOP

        靜思自在 : 為人處世要小心細心,但不要「小心眼」。
返回列表 上一主題