Closed

Populate a Adobe PDF form using vb6 code

This project received 17 bids from talented freelancers with an average bid price of $292 USD.

Get free quotes for a project like this
Employer working
Project Budget
N/A
Total Bids
17
Project Description

I just need a vb6 code that do the following tasks:
1-Open a pdf file created with Adobe Live Cycle Designer
2-Change the value property of 4 text fields
3-Save the pdf file
4-close the pdf file

I already have the code but for some reason it does not work:

Declarations
Option Explicit

Dim gApp As [url removed, login to view]
Dim gPDDoc As [url removed, login to view]
Dim jso As Object ' this is the java script object

Dim iFileName As String
Dim iNewFileName As String
Dim iTopWarningField As Object
Dim iCurrentDateField As Object
Dim iLastNameField As Object
Dim iFirstNameField As Object
Dim SaveRet As Integer


Private Sub Command1_Click()

iFileName = "C:\Documents and Settings\User\My Documents\cfrm\pdf\New Patient Form.pdf"
iNewFileName = "C:\Documents and Settings\User\My Documents\cfrm\pdf\New Patient Form.pdf"

Set gApp = CreateObject("AcroExch.App")
Set gPDDoc = CreateObject("AcroExch.PDDoc")

If [url removed, login to view](iFileName) Then
Set jso = [url removed, login to view] 'set the java script object

'Now start to get a pointer to the pdf fields
Set iTopWarningField = [url removed, login to view]("F1[0].Page1[0].TopWarning[0]")
Set iCurrentDateField = [url removed, login to view]("F1[0].Page1[0].CurrentDate[0]")
Set iFirstNameField = [url removed, login to view]("F1[0].Page1[0].Patient[0].FirstName[0]")
Set iLastNameField = [url removed, login to view]("F1[0].Page1[0].Patient[0].LastName[0]")

'Now start to set the property value of the text fields in the pdf form
[url removed, login to view] = "text"
[url removed, login to view] = CStr([url removed, login to view])
[url removed, login to view] = [url removed, login to view]
[url removed, login to view] = [url removed, login to view]

[url removed, login to view] "New Patient Form_API"

'[url removed, login to view] (PDDocRequiresFullSave)
SaveRet = [url removed, login to view](PDSaveFull, iNewFileName) '-1 if saved successfully
[url removed, login to view]
End If
End Sub

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online