我有以下宏,用于快速切换两个PDF。在8个快速切换宏之后,应该转到两个PDF的下一页并重复该过程。不幸的是,宏滚动首先只声明了PDF。有任何想法如何修改它?
boolean
integer
double
string
array
object
resource
NULL
unknown type
我也尝试使用SendMessage,但它不想将任何PDF移动到下一页。
答案 0 :(得分:0)
尝试这种方法。经过测试和工作。您可以更改等号以延长延迟时间。确保PDF文件名称正确,文件名上没有额外的空格。
Sub switching_pdfs()
Dim i As Integer, j As Integer
Dim ptr1 As String, ptr2 As String
ptr1 = "Some PDF 1.pdf - Acrobat Reader"
ptr2 = "Some PDF 2.pdf - Acrobat Reader"
For i = 1 To 30
For j = 1 To 4
AppActivate ptr1
Wait 0.5
AppActivate ptr2
Wait 0.5
Next j
AppActivate ptr1
Send "{RIGHT}"
Wait 1
AppActivate ptr2
Send "{RIGHT}"
Wait 1
Next i
End Sub
Function Send(pData As String)
SendKeys pData, True
Wait 0.5
End Function
Function Wait(Optional pWaitTime As Single = 0.1)
Dim StartTime
StartTime = Timer
Do While (Timer < StartTime + pWaitTime)
DoEvents
Loop
End Function