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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving current PDF from VB with a new name 1

Status
Not open for further replies.
Jan 28, 2004
19
US
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...

 

You probably want to post your question here: forum705

This is a VB 6, and you have a VBA question. Common mistake.... :)

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top