954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Open PDF file from textbox path

Hi friends,

i have a textbox where i have a path of the pdf file. now after pressing a cummand button i want this file to be opened.

my code is as follows..

Private Sub wazopen_Click()
Dim myfol As String
Dim myfln As String
Dim myfpath As String

myfol = "C:\Dokumente und Einstellungen\singava\Eigene Dateien\Eigene Bilder\T_online Rechnungen\"
myfln = Me.txtwaz
myfpath = myfol & myfln
Application.FollowHyperlink myfpath

End Sub

but i am getting an error here..permission denied...

is there any method where i can open this pdf file taking the path from a textbox.

Thanks friends

singoi
Newbie Poster
10 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

No problem..resolved

Private Sub wazopen_Click()

Dim myfol As String
Dim myfln As String
Dim myfpath As String
Dim PA As String
Dim AcrobatReader As String
AcrobatReader = "C:\Programme\Adobe\Reader 9.0\Reader\AcroRd32.exe "
myfol = "C:\Dokumente und Einstellungen\singava\Eigene Dateien\Eigene Bilder\T_online Rechnungen\"
myfln = Me.txtwaz
myfpath = myfol & myfln

PA = AcrobatReader & myfpath
Shell PA, vbNormalFocus

End Sub

singoi
Newbie Poster
10 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

Hi!
I don't think that we need that much line of code to open the pdf file.
We can just use "shel"l function to open the file.
Private Sub Command1_click()
shell text1.text
End Sub

Thanks & Regards
ritesh

riteshbhushan23
Newbie Poster
2 posts since Aug 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You