Hi Clinton.
This:
Set wdData = wd.Open("R:\doc1.doc"
For Output As #1
won't work. The Open...for Output/Input/Append is for text files, not for (binary encoded) DOCs.
Here's some code of mine which I use to export text from an Excel sheet to a Worddoc. Feel free to use it and adapt it to your needs.
The "ExtractXLS.cfg" and BrowseForFolder part is to keep it useable on other machines. Path to Winword.exe will be stored in this little config. If you don't need that - leave it away..
I have only left away / commented out the most obviously useless part for your side and already tried to adapt the code slightly
[blue]
Sub ExportText()
Dim sh As Worksheet
Dim i As Integer, j As Integer, a As Integer
Dim msg, wort As String
Dim doc As Word.Document, wrd As Word.Application
Dim WordPath As String, buffer As String, Tagg As String
a = FreeFile
Open "C:\ExtractXLS.cfg" For Random As a
Get a, 2, buffer
If buffer <> "" Then
WordPath = buffer
Else
MsgBox "Word 2000 - directory not determined.", vbInformation + vbOKOnly, "Word 2000"
WordPath = BrowseForFolder("Please specify MS Office folder"

buffer = WordPath & "\Winword.exe"
WordPath = buffer
Put #a, 1, ""
Put #a, 2, buffer
End If
Close a
AppActivate Shell(WordPath, 1), True
DoEvents
Set doc = Word.Documents.Open("R:\doc1.doc"

Set wrd = doc.Application
On Error Resume Next 'Just keep goin
wrd.Selection.TypeText "$$$Workbook: " & Excel.ActiveWorkbook.Name & vbCrLf
For Each sh In Me.Worksheets
msg = MsgBox( "Export " & sh.Name & "?", vbQuestion + vbYesNoCancel)
If msg = vbCancel Then GoTo Schluss
If msg = vbNo Then GoTo skipme
wrd.Selection.TypeText "$$$Sheet: " & sh.Name
For j = 1 To sh.Columns.Count
For i = 1 To sh.Rows.Count
wort = Cells(i, j)
'Replace Line feed with <:sr>
wort = Replace(wort, Chr(10), "<:sr>"

'Set Tags
'fon = Cells(i, j).Font.Name
Tagg = "<Cells(" & i & ", " & j & "

" & ">"
wrd.Selection.TypeText Tagg & wort & "</Cells>" & vbCrLf
Next
Next
skipme:
Next
Schluss:
End Sub
Public Function BrowseForFolder(sTitle As String)
Dim ctrShell As New Shell
Dim f As Folder
Dim fi As FolderItem
Set f = ctrShell.BrowseForFolder(0, sTitle, 1)
On Error GoTo Err_Canceled
Set fi = f.Items.Item
BrowseForFolder = fi.Path
Exit Function
Err_Canceled:
BrowseForFolder = ""
End Function
[/blue]
Hope this helps you,
Andy
Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP: