I am using VFP and am having a problem setting the values of fields in a PDF file. I know there is a field named "Amount" in the open PDF. When I run
Create PdfViewer Object
Set License
Open PDF file and then attempt to set a value using
pdfviewer.ObjectAttributeStr("Amount","Value","56")
I get an OLE unspecified error.
I would appreciate any help you can give.
Problem with ObjectAttributeStr
Hello,
Please call:
pdfviewer.ObjectAttribute("Amount","Value","56")
I am not sure which application you are using but in genearl you need to assign the value 56 to the Field object so you need to call something similar to:
pdfviewer.ObjectAttribute("Amount","Value") = 56
Hope this helps, if not please send us an e-mail to support@amyuni.com
Thanks.
Please call:
pdfviewer.ObjectAttribute("Amount","Value","56")
I am not sure which application you are using but in genearl you need to assign the value 56 to the Field object so you need to call something similar to:
pdfviewer.ObjectAttribute("Amount","Value") = 56
Hope this helps, if not please send us an e-mail to support@amyuni.com
Thanks.
Details on Solution
The problem was solved when Jose sent me code samples. That code is:
#DEFINE acCommandToolRunDocument 53776
#DEFINE acReportStateRun 0
#DEFINE acReportStateDesign 1
#DEFINE acReportStateLoading 2
PDFviewer = CREATEOBJECT("PDFCreactiveX.PDFCreactiveX")
PDFviewer.setlicenseKey ("Suite Evaluation
Version","07EFCDAB010001001DB5BDE6C025C760E6DFC8F69516B8E88246C496DA67FA90D447CE
8B1BEFC7EDF6DC0B7029903DEA9970304D24B61D2AA3A72E0302C0C90EB051EE3FDBAC800A3B74A2
AE0D84D10A52")
PDFviewer.Open("c:\temp\g7m_fi.pdf","")
&& Move to current page - not clear in manual
PDFviewer.currentpage = 1
&&change report state - not clear in manual
PDFviewer.reportstate = acReportStateDesign
&& Change the value of the sample object. This object must exist
&& I am using VFP , others would use the comand ObjectAttribute
PDFviewer.ObjectAttributeStr("Amount", "Text", "56")
&& compile changes - not clear in manual
PDFviewer.DoCommandTool(acCommandToolRunDocument)
&& otherwise document will print off page in all likelihood
PDFviewer.ScaleToPrinter = 3
&& Prompt for printer name
PDFviewer.Print("", 1)
PDFviewer= .NULL.
#DEFINE acCommandToolRunDocument 53776
#DEFINE acReportStateRun 0
#DEFINE acReportStateDesign 1
#DEFINE acReportStateLoading 2
PDFviewer = CREATEOBJECT("PDFCreactiveX.PDFCreactiveX")
PDFviewer.setlicenseKey ("Suite Evaluation
Version","07EFCDAB010001001DB5BDE6C025C760E6DFC8F69516B8E88246C496DA67FA90D447CE
8B1BEFC7EDF6DC0B7029903DEA9970304D24B61D2AA3A72E0302C0C90EB051EE3FDBAC800A3B74A2
AE0D84D10A52")
PDFviewer.Open("c:\temp\g7m_fi.pdf","")
&& Move to current page - not clear in manual
PDFviewer.currentpage = 1
&&change report state - not clear in manual
PDFviewer.reportstate = acReportStateDesign
&& Change the value of the sample object. This object must exist
&& I am using VFP , others would use the comand ObjectAttribute
PDFviewer.ObjectAttributeStr("Amount", "Text", "56")
&& compile changes - not clear in manual
PDFviewer.DoCommandTool(acCommandToolRunDocument)
&& otherwise document will print off page in all likelihood
PDFviewer.ScaleToPrinter = 3
&& Prompt for printer name
PDFviewer.Print("", 1)
PDFviewer= .NULL.