Hi,
the two links are to a couple of posts detailing how to open files.
http://groups-beta.google.com/group...8a804cc855?q=xwordobj&rnum=2#c58a0a8a804cc855
http://groups-beta.google.com/group...bf16047432?q=xwordobj&rnum=1#5fe926bf16047432
some code to write documents into an image field
Dim adoDocument As New ADODB.Recordset
Dim mStream As ADODB.Stream
Dim SQL As String
SQL = "Select Doc_Embed,FileName from TblCandidate_Contact_History
Where Candidate_Contact_History_ID=" & strID
Set adoDocument = New ADODB.Recordset
adoDocument.Open SQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
Set mStream = New ADODB.Stream
With mStream
.Type = adTypeBinary
.Open
.LoadFromFile strFileName
End With
With adoDocument
.Fields("Doc_Embed").Value = mStream.Read
.Fields("Filename").Value = strFileName
.Update
.Close
End With
some code to write the document out to the temp folder
Dim adoDocument As New ADODB.Recordset
Dim mStream As ADODB.Stream
Dim SQL As String
Dim strTemp As String
strTemp = Environ("Temp")
SQL = "Select Doc_Embed from TblCandidate_Contact_History Where
Candidate_Contact_History_ID=" & strID
Set adoDocument = New ADODB.Recordset
adoDocument.Open SQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
Set mStream = New ADODB.Stream
With mStream
.Type = adTypeBinary
.Open
.Write adoDocument.Fields("Doc_Embed").Value
.SaveToFile strTemp & "\" & strID & ".doc",
adSaveCreateOverWrite
End With
ReadFromDB = strTemp & "\" & strID & ".doc"
adoDocument.Close
using the above code with the 2 post above should get you on your way.
Any problems post back
Regards
Alex