OLE automation

  • Thread starter Thread starter DJN
  • Start date Start date
D

DJN

Guest
posted August 13, 2002 10:27 AM
--------------------------------------------------------------------------------
I am not sure that this is even possible but here goes. The problem is this. I have an unbound OLE object frame that I would like to click or double click in and open Word in a particular word document, so that the text is shown in the unbound object frame. These documents are work instructions and could be very long. As such, I do not wish to use a memo field. The other reason is that I can control the formatting of a word document. The document name would be in a table . Any help would be gratefully accepted.

David
 
You don't need the frame. Just store the doc name (xxx.doc) in a text field. Then on a form, add a command button next to the doc field text box. Add the code below to the command on On Click event.

Private Sub Command0_Click()
Dim strFileName As String
If Me.DocFileName <>"" Or Not IsNull(Me.DocFileName) Then
strFileName = "c:\doc\" & Me.DocFileName
If Dir(strFileName)<>"" Then
FollowHyperlink "c:\doc\" & Me.DocFileName
Else
MsgBox strFileName & " not found", vbOKOnly, "Oops!"
End If
End If
End Sub
 
Many thanks Tim. I will give it a try.



David
 

Users who are viewing this thread

Back
Top Bottom