Code for a Command button

A

Alan

I have set the following code on the click event on a command button that
when clicked opens a PDF file on my hard disk.

Private Sub Command88_Click()
On Error GoTo Err_Command88_Click

Dim gPath As String
gPath = Me!gPath

Application.FollowHyperlink gPath

Exit_Command88_Click:
Exit Sub

Err_Command88_Click:
MsgBox Err.Description
Resume Exit_Command88_Click

End Sub

The problem I have is that before it opens the PDF file a message box pops
us stating:

Microsoft office (msg box heading)

some files can contain virus or otherwise be harmful to your computer. It
is important to be certain that this file is from a trustworthy source.
Would you like to open the file. (then two option buttons) OK or CANCEL

Is there a way of stopping this coming up I have tried the setwarning to
false action but this has no effect. Any help with this one would be
appreciated.
 
A

Alan

Thanks for the information, method 2 worked fine on my 2002 Office. I have
been trying for hours many thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top