Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a Textfield on PDF Document from VB

Status
Not open for further replies.
Jan 28, 2004
19
US
The code below allow me to open PDF and Word files Respectively, but I would like to update the FirstNAME and LastName field on any PDF file open.

The FirstName and Lastname are been pulled from a table and and is currently hidden on an access form.

Thanks again for your help...

Code....

Private Sub Combo7_AfterUpdate()
Dim DT As Date, DTConv As String
DTConv = Format(Now, "mmddyyyyHHMMSS")

Patient = [FIRSTNAME] & "_" & MIDDLENAME & [LASTNAME] & "_" & [DTConv] & "_"
Dim template As String, WORD_EXE As String, PDF_EXE As String
Dim WordTemplate As String


WORD_EXE = "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE "
'PDF_EXE = "c:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe "
PDF_EXE = "c:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe "

'c:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe
Dim loc As String, Destination As String, SourceFile As String, PDF_EXT As String

Dim filesel As String
loc = "c:\Corrections_CFW\Test\Destination\"
PDF_EXT = ".pdf"

filesel = Combo7
SourceFile = "C:\Corrections_CFW\Test\" & filesel
Destination = "C:\Corrections_CFW\Test\Destination\" & Patient & filesel

If Combo7 = "Audit.doc" Then

FileCopy SourceFile, Destination

WordTemplate = WORD_EXE & Destination

Call Shell(WordTemplate, 1)

Combo7 = "Select Form to Sign"
Exit Sub

Else
'MsgBox ("Template Source:" & Space(2) & SourceFile)
'MsgBox ("Destination File" & Space(2) & Destination)

FileCopy SourceFile, Destination
template = PDF_EXE & Destination

Call Shell(template, 1)
Combo7 = "Select Form to Sign"
Exit_Combo7_Click:
Exit Sub
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top