vba - 在一个文件夹中的 pdf 文件上循环、打开、执行 SendKeys
问题描述
Sub Password()
'Loop through all files in a folder
Dim fileName As Variant
fileName = Dir("C:\State_K-1_Info\Password\*.pdf")
Do While fileName <> ""
CreateObject("Shell.Application").Open ("C:\State_K-1_Info\Password\001.pdf")
Application.Wait Now + 0.00005
'Insert the actions to be performed on each file
'This example will print the file name to the immediate window
Application.SendKeys "{Tab}", True
Application.SendKeys "^(s)", True
Application.SendKeys "%{F4}", True
'Set the fileName to the next file
fileName = Dir
Loop
End Sub
不幸的是,这只是不断打开和关闭我的创建对象行中引用的文件夹中的第一个文件
解决方案
推荐阅读
- kubernetes - 使用 Kustomize 将 ConfigMap 一分为二
- javascript - 如何在数组中使用切片 JS
- elasticsearch - Elasticsearch 聚合以检索与另一个值关联的值数组
- c# - 如果类具有同名的嵌套类,则无法访问继承的属性
- java - CrudRepository - Hibernate - 用手动设置 id 覆盖现有模型
- python - 在 manim 中发出带有 play() 函数的问题
- docker - 当图像从 Kubernetes 集群中的另一个微服务提供时,如何使用下一个 js 图像优化?
- ios - 在 SwiftUI 中全屏显示颜色
- python - tkinter、pandas 和 python,怎么做
- javascript - TypeError:无法读取属性“错误”和 TypeError:无法获取