open file problem

MvP14

Registered User.
Local time
Today, 21:21
Joined
Apr 15, 2003
Messages
66
I can't solve this one:

I have

Code:
Private sub Openfile_Click()

dig G as Long
Dim strDocpath as string

strdocpath = "C:\Users\MvP\Documents\manual.pdf"

G = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler " & strDocPath, vbNormalFocus)

End Sub

The strDocpath is correct, but the file won't open.

I use similar code on other forms and it poses no problem.

I can't find the cause. Any suggestions? Thank you in advance.
 
This is a stab in the dark but maybe you have a missing reference - ?
 
Is there a reason you have to use Shell and not

Application.FollowHyperlink strDocPath
 

Users who are viewing this thread

Back
Top Bottom