I don't know that you can do this still using a hyperlink field, but how
about:
-using a plain textbox, IsHyperlink = False
-change the font to blue, underscore
-trap the Click event of the textbox.
*Air Code*
- assumes textbox is named txtDocument
- assumes read-only status is stored in bReadOnly (could be control on form,
etc.)
- uses References to Word and Excel
- could be done with late binding (Dim As Object,
CreateObject("Word.Application"))
Select Case Right(txtDocument, 4)
Case ".doc"
Set appWord = New Word.Application
appWord.Documents.Open txtDocument, , bReadOnly
Set appWord = Nothing
Case ".xls"
appExcel = New Excel.Application
appExcel.Workbooks.Open txtDocument, , bReadOnly 'third argument is
read-only state
Set appExcel = Nothing
Case Else
'for unspecified types, you can't force a read-only
'you can still use the Windows associated action with
FollowHyperlink
Application.FollowHyperlink txtDocument
End Select
-------------
Opening a file as read-only is dependent on application-specific
information. However, you probably will know ahead of time the important
types of documents to use and can spell out specific code. Use
Application.FollowHyperlink to revert to "old way"
HTH,
Kevin