If Dir(strWordFile$) <> "" Then 'strWordFile是文件目录及文件名
file_len1 = FileLen(strWordFile$)
ReDim s1(file_len1 - 1) As Byte
Open strWordFile$ For Binary As #1
Get #1, 1, s1
Close #1
RS.Fields("DocFile").Value = s1
RS.Update
End If
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long '申明
Private Sub Command1_Click()
Dim A
............. '打开数据库及数据集
A = RS.Fields("DocFile") '数据库中的OLE字段(Word文档)
Open "\temp\User.Doc" For Binary As #1 '打开输出文件。Temp目录下。
Put #1, 1, A
Close #1 '关闭文件。
ShellExecute Me.hWnd, "open", "C:\User.doc", vbNullString, vbNullString, SW_SHOW '打开保存后的文件