![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Script to read information inside a pdf file Hi ! I use the following VBA programmation to complete a pdf form (using SendKeys). Once the form is completed, the users can make modifications. After the form has been modified, the user return in Excel and save the pdf parameters. Is there a way to catch the selection content of a pdf file? When the PDF document is activated, the command Application.SendKeys send the value in the PDF document but Application.Selection doesn't return the PDF selection. Any idea? Actual VBA code to modify a pdf document: Dim myIE As Object Dim dReturnValue As Double Set myIE = CreateObject("InternetExplorer.Application") myIE.navigate "http:\\... \file.pdf 'Open the pdf myIE.Visible = True dReturnValue = Shell("IEXPLORER.EXE", vbNormalFocus) AppActivate dReturnValue 'Activate the pdf Application.SendKeys "{TAB}", True Application.SendKeys "TEXTVALUE1", True Application.SendKeys "{TAB}", True Application.SendKeys "TEXTVALUE2", True etc. I would like something that do the same steps but record the selection in each pdf cell's like: 'Save PDF information AppActivate dReturnValue 'Activate the .pdf Application.ReturnToTheBeginningOfTheFile (Can be done using Shift-Tab...) Application.SendKeys "{TAB}", True vInformation = Application.Selection 'This doesn't word (???) Thisworkbook.Sheets("Sheet1").Cells(1,1) = vInformation AppActivate dReturnValue 'Activate PDF Application.SendKeys "{TAB}", True vInformation = Application.Selection 'Read the contents of the box #2 Thisworkbook.Sheets("Sheet1").Cells(2,1) = vInformation etc. Thank's a lot! Alex -- Alex St-Pierre |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Script to read information inside a pdf file On Oct 7, 11:46*am, Alex St-Pierre <AlexStPie...@newsgroup> wrote: Quote: > Hi ! > I use the following VBA programmation to complete a pdf form (using > SendKeys). Once the form is completed, the users can make modifications. > After the form has been modified, the user return in Excel and save the pdf > parameters. Is there a way to catch the selection content of a pdf file? When > the PDF document is activated, the command Application.SendKeys send the > value in the PDF document but Application.Selection doesn't return the PDF > selection. Any idea? > > Actual VBA code to modify a pdf document: > Dim myIE As Object > Dim dReturnValue As Double > Set myIE = CreateObject("InternetExplorer.Application") > myIE.navigate "http:\\... \file.pdf 'Open the pdf > myIE.Visible = True > dReturnValue = Shell("IEXPLORER.EXE", vbNormalFocus) > AppActivate dReturnValue 'Activate the pdf > Application.SendKeys "{TAB}", True > Application.SendKeys "TEXTVALUE1", True > Application.SendKeys "{TAB}", True > Application.SendKeys "TEXTVALUE2", True > etc. > I would like something that do the same steps but record the selection in > each pdf cell's like: > 'Save PDF information > AppActivate dReturnValue 'Activate the .pdf > Application.ReturnToTheBeginningOfTheFile (Can be done using Shift-Tab...) > Application.SendKeys "{TAB}", True > vInformation = Application.Selection 'This doesn't word (???) > Thisworkbook.Sheets("Sheet1").Cells(1,1) = vInformation > AppActivate dReturnValue 'Activate PDF > Application.SendKeys "{TAB}", True > vInformation = Application.Selection 'Read the contents of the box #2 > Thisworkbook.Sheets("Sheet1").Cells(2,1) = vInformation > etc. > > Thank's a lot! > Alex > > -- > Alex St-Pierre AppActivate dReturnValue 'Activate the .pdf Application.ReturnToTheBeginningOfTheFile (Can be done using Shift- Tab...) For i = 1 To nTextBoxes GetText i, 1 Next End Sub Sub GetText(nRow, nCol) Application.SendKeys "{TAB}^c", True ' Copies form data ThisWorkbook.Sheets("Sheet1").Paste _ ThisWorkbook.Sheets("Sheet1").Cells(nRow, nCol) End Sub _____________________ Tom Lavedas |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| batch file / script to replace information | VB Script | |||
| How can I resolve %WINDIR% inside a PowerShell script? | PowerShell | |||
| Question: The clock in vista can not synchronize - read inside please | Vista performance & maintenance | |||
| change permission on all files inside a folder or hundreds of file inside a folder | Vista security | |||
| System information inside, help on reintall of Vista requested | Vista General | |||