B
Bill Murphy
I have a subform where one column named FileName is formatted as a
hyperlink, and contains the full path and names of files located on the
user's local drive or network drive. I would like the user to be able to
preview Word, Excel and PDF documents, but prevent certain file types from
opening, such as zip files. Here's some sample code that I tried in order
to prevent a zip file from being opened when the user clicks on the
hyperlink:
If Right(FileName, 4) = "zip#" Then
MsgBox "Zip files cannot be previewed"
Exit Sub
End If
The # is needed since this is stored in the hyperlink by Access. This code
runs, but as soon as the sub is exited Access tries to open the zip file. I
tried conditional formatting for this column, but the IsHyperlink format
can't be removed at run time.
Is there a way to prevent certain file types such as zip files from being
executed in the click event?
Bill
hyperlink, and contains the full path and names of files located on the
user's local drive or network drive. I would like the user to be able to
preview Word, Excel and PDF documents, but prevent certain file types from
opening, such as zip files. Here's some sample code that I tried in order
to prevent a zip file from being opened when the user clicks on the
hyperlink:
If Right(FileName, 4) = "zip#" Then
MsgBox "Zip files cannot be previewed"
Exit Sub
End If
The # is needed since this is stored in the hyperlink by Access. This code
runs, but as soon as the sub is exited Access tries to open the zip file. I
tried conditional formatting for this column, but the IsHyperlink format
can't be removed at run time.
Is there a way to prevent certain file types such as zip files from being
executed in the click event?
Bill