willfindaway
MIS
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
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