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

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.