H
hemaneelagiri via OfficeKB.com
hi
i amd loading data from DB with VBA and my msword is 2003 with sp3
one of my column datatype is image[ in that i am storing data as bynarydata]
i am loading that data into my active document selection with below code
Private Sub LoadFile(ByVal objValue As Variant)
Dim sFileName As String
Dim mStream As Object
On Error Resume Next
sFileName = GetTempDir() & "temp123.doc"
Set mStream = CreateObject("ADODB.Stream")
With mStream
.Type = 1
.Open
.Write objValue
.SaveToFile sFileName, 2
End With
Set mStream = Nothing
Selection.InsertFile sFileName
On Error GoTo 0
End Sub
but the data is coming as junk and many pages(some hunders of pages)
when i am commented "on error" then below errors are coming
"arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another"
"Word cannot start the converter mswrd632"
can u please help me
i amd loading data from DB with VBA and my msword is 2003 with sp3
one of my column datatype is image[ in that i am storing data as bynarydata]
i am loading that data into my active document selection with below code
Private Sub LoadFile(ByVal objValue As Variant)
Dim sFileName As String
Dim mStream As Object
On Error Resume Next
sFileName = GetTempDir() & "temp123.doc"
Set mStream = CreateObject("ADODB.Stream")
With mStream
.Type = 1
.Open
.Write objValue
.SaveToFile sFileName, 2
End With
Set mStream = Nothing
Selection.InsertFile sFileName
On Error GoTo 0
End Sub
but the data is coming as junk and many pages(some hunders of pages)
when i am commented "on error" then below errors are coming
"arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another"
"Word cannot start the converter mswrd632"
can u please help me