我正在尝试使用脚本使用AUtoIT填充PDF可填写表单。让我的代理人工作轻松。我想填写pdf字段。最初我正在测试单个字段 Fname_c [0] ,但它没有填充值
下面是我试过的代码
$FilePath = "Form.pdf"
If $FilePath =-1 Then
MsgBox(0, "Error", "No file.")
Exit
EndIf
$fieldname = "Fname_C[0]"
$fileOut = "Form2.pdf"
$App = ObjCreate("AcroExch.App")
$AVDoc = ObjCreate("AcroExch.AVDoc")
If $AVDoc.Open($FilePath, "") Then
$PDDoc = $AVDoc.GetPDDoc
$AForm = ObjCreate("AFormAut.App")
$EX = "" _
& ' var f = this.getField("' & $fieldname & '")' & @LF _
& ' f.value = "Sunil"'
$AForm.Fields.ExecuteThisJavaScript($EX)
$PDDoc.save(1, $fileOut)
$App.closeAlldocs()
$App.exit()
Else
MsgBox(0, "", "Coudn't open report")
EndIf
;; release objects
$AForm = 0
$AVDoc = 0
$PDDoc = 0
$App = 0
我做错了什么?