General information
Category:
COM/DCOM and OLE Automation
Thanks for your fast response. and thanks for your time..
the scenario i am working with is a little different.
I am required to open an acrobat form (a template) that contains multiple fields that require to be filled with data from a vfp set of tables.
After that, save the resulting acrobat form file (not the template) into a folder, close the file and close the template.
here is the code I am working with:
lcSrcFName = 'XXXX Contract Merge.pdf'
lcSrcDir = 'c:\temp\docs\'
lcFileName = Forceext(Addbs(lcSrcDir)+Alltrim(lcSrcFName),'pdf')
If File(lcFileName)
gApp = Createobject("AcroExch.App") && acrobat object
gAVDoc = Createobject("AcroExch.AVDoc") && user interface object
If gAVDoc.Open(lcFileName, "RDM Contract")
gPDDoc = gAVDoc.getPDDoc() && underlying pdf document representation
gApp.minimize(.t.)
gApp.Show
gFrmApp = Createobject("AFormAut.App")
loFields =gFrmApp.Fields
lnFields = loFields.Count()
For Each loField In gFrmApp.Fields
lcFldType = loField.Type
lcFldROnly = loField.Isreadonly
lcFldVal = loField.Value
Do Case
......................... do something with field value, type and readonly properties..
Endcase
Endfor
gPDDoc.Save(1,'d:\mydocuments\rdmcontract'+Dtos(Date())+'.pdf')
Endif
If gApp.getnumavdocs >0
gApp.CloseAllDocs()
Endif
gApp.Hide()
gApp.Exit()
Endif
gPDDoc = .Null.
gAVDoc = .Null.
gFrmApp = .Null.
gApp = .Null.
loField = .Null.
loFields = .Null.
loFItem = .Null.
Return
If I hide acrobat, I can not work with form fields..(error is 'not open document'). minimize and show both of them display the document
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only