PC Review


Reply
Thread Tools Rate Thread

Complete .PDF form in VBA

 
 
Alex St-Pierre
Guest
Posts: n/a
 
      6th Oct 2009
Hi !
I can open a pdf file in VBA using the following code. Is there a way to
copy a text in a specific box inside the .pdf (the pdf file has boxes that
need to be completed). I don't need to save the pdf file (just open it and
complete it)
Is there a Adobe library that can be used to select box#1, #2, etc.
Thank's a lot!
Alex

Dim myIE As Object
Set myIE = CreateObject("InternetExplorer.Application")

myURL = "C:\myPdfFile.pdf"
On Error Resume Next
myIE.navigate myURL
myIE.Visible = True
On Error GoTo 0
--
Alex St-Pierre
 
Reply With Quote
 
 
 
 
Alex St-Pierre
Guest
Posts: n/a
 
      7th Oct 2009
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


"Alex St-Pierre" wrote:

> Hi !
> I can open a pdf file in VBA using the following code. Is there a way to
> copy a text in a specific box inside the .pdf (the pdf file has boxes that
> need to be completed). I don't need to save the pdf file (just open it and
> complete it)
> Is there a Adobe library that can be used to select box#1, #2, etc.
> Thank's a lot!
> Alex
>
> Dim myIE As Object
> Set myIE = CreateObject("InternetExplorer.Application")
>
> myURL = "C:\myPdfFile.pdf"
> On Error Resume Next
> myIE.navigate myURL
> myIE.Visible = True
> On Error GoTo 0
> --
> Alex St-Pierre

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Q: form authentication complete? =?Utf-8?B?SklNLkgu?= Microsoft ASP .NET 3 25th Jun 2005 05:05 AM
Auto Form Complete =?Utf-8?B?TWlja2V5?= Windows XP Internet Explorer 1 16th Jan 2005 08:12 PM
Moving data from form to form (Complete) James Microsoft Access Form Coding 3 29th Oct 2003 10:04 AM
Form Auto Complete KB Windows XP Internet Explorer 3 14th Aug 2003 01:43 AM
Excel Form / Tab to complete Rhonda Microsoft Excel Misc 4 19th Jul 2003 06:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:07 PM.