Retrieving field names on a form
hi,
i have used below code retieve field names form acrobat 5. has worked fine, have upgraded acrobat 9 , same code errors when executing line 'set fields = aformaut.flelds' getting type mismatch error. simple funtion in vb6 retrieves field names , associated types in comma seperated string?
does know why code not work in acrobat 9? or there better way achieve same results acrobat 9?
thanks
public function fieldlist(byval formname string, ofields string, otypes string)
dim aformaut aformautlib.aformapp
dim fields aformautlib.fields
dim field aformautlib.field
dim acroexchavdoc cacroavdoc
dim bok boolean
on error goto errorhandler
set acroexchavdoc = createobject("acroexch.avdoc")
bok = acroexchavdoc.open("c:\iht400.pdf", "")
'if ok opening pdf, can instantiate the
'forms automation object
if (bok) then
set aformaut = createobject("aformaut.app")
set fields = aformaut.fields ' line errors
each field in fields
if field.isterminal then
if ofields = "" then
ofields = field.name
otypes = field.type
else
ofields = ofields + "," + field.name
otypes = otypes + "," + field.type
end if
end if
next field
bok = acroexchavdoc.close(true)
end if
set acroexchavdoc = nothing
set aformaut = nothing
set field = nothing
errorhandler:
msgbox "fieldlist error: " + err.number + " " + err.description + " " + err.source
resume next
end function
was form created adobe acrobat?
More discussions in Acrobat SDK
adobe
Comments
Post a Comment