• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

Feeding a form created in Acrobat 7.0

I have a form created in Acrobat 7.0. It contains some radio buttons and some check boxes. I have to fill the values in this form through VB 6.0 application. How to do it. I am able to fill data in text boxes and combo boxes but unable to fill radio buttons and check boxes. I am using jsoobject to fill pdf file. Please proveide me the solution immediately.
1 Solution
mdasoftAuthor Commented:
When i fill the values in radio button and display the form in Pdf immediately it displays the filled data but after saving the form all the details of radio buttons disappears
That might be because you used a wrong method or property of a field.

Put a commandbutton and a commondialog on a form and try the following code. It will check all the checkboxes in a PDF form.

Private Sub Command1_Click()
    Dim pdDoc As Acrobat.CAcroPDDoc
    Dim page As Acrobat.CAcroPDPage
    Dim objJS As Object
    Dim path As String
    Dim objField As Object
    Dim intRowCount As Integer
    Dim strFieldName As String
    path = CommonDialog1.FileName
    Set pdDoc = CreateObject("AcroExch.PDDoc")
    If pdDoc.Open(path) Then
        Set objJS = pdDoc.GetJSObject
        If Not objJS Is Nothing Then
            For intRowCount = 0 To objJS.numFields - 1
            '//getNthFieldName gets fieldname given the index
            strFieldName = objJS.getNthFieldName(intRowCount)
            '//getField gets the field element
            Set objField = objJS.getField(strFieldName)
            Debug.Print strFieldName, objField.Type, objField.valueAsString
            If objField.Type = "checkbox" Then
                Call objField.checkThisBox(0, True)
                Debug.Print strFieldName, objField.Type, objField.valueAsString
            End If
        End If
    End If
    pdDoc.Save PDSaveIncremental, path
    Set pdDoc = Nothing
End Sub


Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now