willfindaway
MIS
I am new to VB and I am trying to use the code below to open selected PDF and Word Files.
My code allow me to open the required files but I am having a hard time saving the PDF file from VB. MY hope is to save current open document with a new name.
For example, if the file opened was called test.pdf my goal is to save it as testnew.pdf when the save button is clicked on the ACCESS FORM.
Here is the code I have so far...
Private Sub Combo4_AfterUpdate()
Dim template As String, WORD_EXE As String, PDF_EXE As String
WORD_EXE = "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE "
PDF_EXE = "c:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe "
Dim loc As String
Dim filesel As String
loc = "c:\Corrections_CFW\Test\"
filesel = Combo4
If Combo4 = "Audit.doc" Then
'MsgBox ("audit selected")
'template = "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE " & loc & filesel
template = WORD_EXE & loc & filesel
Call Shell(template, 1)
Combo4 = "Select Form to Sign"
'Exit_Combo4_Click:
Exit Sub
Else
template = PDF_EXE & loc & filesel
'template = "c:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe " & loc & filesel
Call Shell(template, 1)
Combo4 = "Select Form to Sign"
Exit_Combo4_Click:
Exit Sub
End If
End Sub
As usual, your help is appreciated.
Thanks a million...
My code allow me to open the required files but I am having a hard time saving the PDF file from VB. MY hope is to save current open document with a new name.
For example, if the file opened was called test.pdf my goal is to save it as testnew.pdf when the save button is clicked on the ACCESS FORM.
Here is the code I have so far...
Private Sub Combo4_AfterUpdate()
Dim template As String, WORD_EXE As String, PDF_EXE As String
WORD_EXE = "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE "
PDF_EXE = "c:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe "
Dim loc As String
Dim filesel As String
loc = "c:\Corrections_CFW\Test\"
filesel = Combo4
If Combo4 = "Audit.doc" Then
'MsgBox ("audit selected")
'template = "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE " & loc & filesel
template = WORD_EXE & loc & filesel
Call Shell(template, 1)
Combo4 = "Select Form to Sign"
'Exit_Combo4_Click:
Exit Sub
Else
template = PDF_EXE & loc & filesel
'template = "c:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe " & loc & filesel
Call Shell(template, 1)
Combo4 = "Select Form to Sign"
Exit_Combo4_Click:
Exit Sub
End If
End Sub
As usual, your help is appreciated.
Thanks a million...