# Extract specific data from pdf to vba textbox



## Tayl4n (Wednesday at 4:00 AM)

Hello,

I hope that everything is going well with you all.

I have a code which can chose pdf clearly. However, my datas in PDF from text parts not from metada. So if I do this TextBox6.Value = acroPDDoc.GetInfo("Producer") then textbox filling as "Xyz". But I can't get the necessary information from here, such as length and weight. TextBox6 is a technical data as kVA in the PDF text section. As I understand PDF text section's type table. So I need to get the data from this table not from metada but my codes are work for metada.

So I need to fill the textbox as "400" 
When I chose this PDF
Rated Power's value to TextBox6

Then result must be like :






Pdf text section which included necessary data like this:






Pdf metada like this:

TitleSubjectKeywordsAuthorCreatorProducerXyzCreationDateFri Dec 23 17:51:01 2022ModDateFri Dec 23 17:55:55 2022TaggednoUserPropertiesnoSuspectsnoFormnoneJavaScriptnoPages2EncryptednoPage size595 x 842 pts (A4)Page rot0File size317234 bytesOptimizednoPDF version1.4







```
Private Sub CommandButton3_Click()

Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
fd.Filters.Clear
fd.Filters.Add "PDF Files", "*.pdf"
If fd.Show = False Then Exit Sub


Dim acroApp As acroApp
Dim acroAVDoc As acroAVDoc

Dim acroPDDoc As acroPDDoc
Set acroApp = CreateObject("AcroExch.App")
Set acroAVDoc = CreateObject("AcroExch.AVDoc")
If acroAVDoc.Open(fd.SelectedItems(1), "") Then
Set acroPDDoc = acroAVDoc.GetPDDoc
Else
MsgBox "Error opening PDF file"
Exit Sub
End If

TextBox6.Value = acroPDDoc.GetInfo("Producer")



acroAVDoc.Close True
Set acroPDDoc = Nothing
Set acroAVDoc = Nothing
Set acroApp = Nothing

End Sub
```


----------



## Tayl4n (Thursday at 12:44 AM)

Hello again everyone. It is an urgent and important project please help


----------



## Tayl4n (Thursday at 5:17 AM)

As far as I collect the information I can use findtext but I don't know how. I can't find an example


----------



## Tayl4n (Yesterday at 1:44 AM)

Is there anyone who can help or guide me? This is an important issue


----------



## Tayl4n (Yesterday at 6:19 AM)

Please help


----------

