I am trying to do something relatively simple but as usual I am doing it using a new medium and have no idea what syntax I need to use.
I have an XFA Form (a PDF created using Live Cycle Designer) which has several text boxes in it. I need to reference a specific text box (in this case "textbox14" - I didn't make the form so the text boxes don't have meaningful names) and pull the text that is entered in it. I will then use that text when saving the PDF so that the file name will contain the data from "textbox14".
I found a great resource with code samples on line for doing this with regular PDF's and the below code works fine to pull the data from a text box named "test1".
Expand|Select|Wrap|Line Numbers
- Private Sub Command0_Click()
- Dim AcroApp As Acrobat.CAcroApp
- Dim theForm As Acrobat.CAcroPDDoc
- Dim jso As Object
- Dim test As String
- Set AcroApp = CreateObject("AcroExch.App")
- Set theForm = CreateObject("AcroExch.PDDoc")
- theForm.Open ("C:\Documents and Settings\joseph.korn\Desktop\testPDF.pdf")
- Set jso = theForm.GetJSObject
- test = jso.getfield("test1").Value
- MsgBox test
- theForm.Close
- AcroApp.Exit
- Set AcroApp = Nothing
- Set theForm = Nothing
- MsgBox "Done"
Thanks!
RugbyKorn