Reaf pdf Fields to Access form / table (1 Viewer)

TesZero

New member
Local time
Today, 06:05
Joined
Jul 15, 2014
Messages
6
Hello again.
I came back with another Headache ;) :) :)

So... i am developing another application.

This application is about Service Quality and it stores the Non-Conformities in the institution.

If there is a Non-Conformities registry we need to contact our sub contracted company and ask them the Corrective Action (how to solve the problem) about that non-conformity registry.

So... all i need is to have a easy way to send a "form" to the other company, receive the data form filled and store it on my database...

I dont want to send a excel file, so i was thinking about a fillable pdf form.

The problem is that i googled a lot and i cant find how to read pdf fields to my access form/table ...

Can someone help me? :|

Best Regards
Pedro Silva
Portugal
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:05
Joined
Feb 19, 2013
Messages
16,610
You need to convert the pdf to excel or word. There are a number of free apps on the web. Or you can use Adobe Acrobat Pro which has a price.

I don't think there is an API you can run from VBA available for the free apps but there is for Acrobat.

Not sure why you are concerned about using Excel. If you are sending out the forms for them to be returned, you could create a locked excel file so the recipient can only complete the required fields - I would do this as an unlocked template then have VBA populate it and then lock it and save as a different name - don't save the template. Much easier than trying to create a potentially complex workbook from VBA. I would make the template a .xls as to lowest common denominator.

You can even include a button or hyperlink on the form which when clicked will create an email and send itself back to you
 

spikepl

Eledittingent Beliped
Local time
Today, 15:05
Joined
Nov 3, 2010
Messages
6,142
Prior to making a selection check what is allowed and acceptable at the recipient end. Sometimes all kinds of stuff gets intercepted by the mail system, such as worksheets with macros etc.
 

TesZero

New member
Local time
Today, 06:05
Joined
Jul 15, 2014
Messages
6
CJ_London and spikepl, many tahnks for your answer :)

PDF would be great.

I only prefer pdf because it is more professional and the company could not have excel. but... i will try that andcreat a excel with protection that allow only to write on speceffic fields, then import it.

But... if someone can help me with PDF, it would be great :)

I found this example:


Private Sub CommandButton1_Click()
Dim AcroApp As Acrobat.CAcroApp
Dim theForm As Acrobat.CAcroPDDoc
Dim jso As Object
Dim text1, text2 As String

Set AcroApp = CreateObject("AcroExch.App")
Set theForm = CreateObject("AcroExch.PDDoc")
theForm.Open ("C:\temp\sampleForm.pdf")
Set jso = theForm.GetJSObject

' get the information from the form fields Text1 and Text2
text1 = jso.getField("Text1").Value
text2 = jso.getField("Text2").Value

MsgBox "Values read from PDF: " & text1 & " " & text2

' set a text field
Dim field2 As Object
Set field2 = jso.getField("Text2")

field2.Value = 13 ' assign the number 13 to the fields value

' get the information from the form fields Text1 and Text2
text1 = jso.getField("Text1").Value
text2 = jso.getField("Text2").Value

MsgBox "Values read from PDF: " & text1 & " " & text2

theForm.Close

AcroApp.Exit
Set AcroApp = Nothing
Set theForm = Nothing

MsgBox "Done"
End Sub


...and it would be great if it works :p
or... if i could make it work

I googled a lot about this before i post the question, when i found it i was very happy, but i can't make it work...

i had created a form and a button, i post the code in the button, but it gave me a reference error.
"Compile Error: User-Difined type not defined" here -> " Dim AcroApp As Acrobat.CAcroApp"

I try to look up for the reference and i saw this, at here in the same website that it user the "acrobat" reference. Sorry i cant put links or pictures for now, only when i have more than 10 posts. :(

but i dont have any "acrobat" reference in my access 2007 vba, i look for acrobat.tld in the internet but when i bowse for the reference it disapear for the list.
At my reference list i have:
- Acrobat Access 3.0 Type Library
- AcroBrokerLib
- AcroIEHelper 1.0 Tyope library
- AcroIEHelperShim 1.0 Type Library
- Adobe 3D utility 1.0 Type Library
- Adobe Acrobat 7.0 Browser Control Type Library 1.0
- Adobe Acrobat 9.0 Type Library

I tryed to use the Adobe Acrobat 9.0 Type Library and it still dosent working..
i got this error:
"run-time error '429': ActiveX component can't creat object. here -> "Set AcroApp = CreateObject("AcroExch.App")"

Again, Thank you for your help.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:05
Joined
Feb 19, 2013
Messages
16,610
Acrobat.CAcroApp

but i dont have any "acrobat" reference in my access 2007 vba
That is from the API (or one of them) I was referring to for Adobe Acrobat. To get the API you will need to buy Acrobat - you can get a trial version for free for one month to see it it meets your requirements - otherwise buy, I think circa 400USD.

You will find references to acrobat (acrobat access 3.0, acrobrokerlib, etc) in VBA but they don't contain the apps/types you need and I suspect are related to being able to print a report to pdf.

Unless anyone knows how to get product specific API without the product?

Sometimes all kinds of stuff gets intercepted by the mail system, such as worksheets with macros etc.
Yeah I had that problem a few years back where excel forms were flying all over the place to different people for authorisation etc. System fell apart when macro documents were filtered out! Problem was resolved by zipping the file before sending
 

TesZero

New member
Local time
Today, 06:05
Joined
Jul 15, 2014
Messages
6
Thank you for answer CJ_London.

Yes, keeping googling this weekend i found the same code when the programmer wrote "this will only work with acrobat sdk pro installed"

I cant buy/ install it because it is to be used in a governamental computers, so... the licences to be bought is not my concern :(

I tried the excel, but i didnt really liked the form and the protected cells...

If i cant find a way to do this... i will make a form to copy / paste manually from email the information, until i find a way to do this data importation from pdf to access automatically.

Thank you for your time :)
 

vbaInet

AWF VIP
Local time
Today, 14:05
Joined
Jan 22, 2010
Messages
26,374
For the pdf to Word conversion you need a free command line pdf to Word utility that does just that. It's through command line you will initiate the conversion. Some free pdf to Word utilities come with command line options. However, you're just adding an extra layer of complexity so this is certainly not a good option.

As for collecting data from clients/partners, you can try the built-in one:
http://office.microsoft.com/en-gb/access-help/collect-data-by-using-e-mail-messages-HA010015427.aspx

Otherwise, use an Excel spreadsheet or even a Word doc for collecting the data, and read it off from there. This isn't going to be easy for you because you will need to first manage how you will identify the e-mails before even thinking of retrieving the attachment (reading the body of the email in-line if that's how you attached it).
 

Users who are viewing this thread

Top Bottom