Jim- I'll provide sample code here (and hopefully it will help); If you can't
get it working, I'd suggest re-posting and indicating what version of Excel
and Word you are using, and where you are getting stuck- is Word not opening?
Is Word open, but your desired contents aren't getting pasted in properly?
etc.
This code should give you a basic starting point; you will still need to use
VBA to cycle through your target column's values to add them to Word instead
of using the WER array.
My apologies to whomever originally posted this code- I didn't capture that
way back (mid 90's?) when I first acquired this snippet.
Best,
Keith
Sub createDoc()
Dim wordApp As Word.Application
Dim wordDoc As Word.Document
Dim wordRng As Word.Range
Dim wordPara As Word.Paragraph
Dim WER(1 To 3) As Variant
Set wordApp = CreateObject("Word.Application")
With wordApp
.WindowState = wdWindowStateMaximize
.Documents.Add
Set wordDoc = wordApp.ActiveDocument
Set wordRng = wordDoc.Range
With wordRng
WER(1) = "tree"
WER(2) = "bed"
WER(3) = "car"
.InsertAfter WER(1)
.InsertParagraphAfter
.InsertAfter WER(2)
.InsertParagraphAfter
.InsertAfter WER(3)
.InsertParagraphAfter
' insert a blank paragraph between the two paragraphs
.InsertParagraphAfter
End With
Set wordPara = wordRng.Paragraphs(3)
With wordPara.Range
.Bold = True
.Italic = False
.Font.Size = 12
.InsertAfter "Report Created: "
.Collapse Direction:=wdCollapseEnd
.InsertDateTime DateTimeFormat:="MM-DD-YY HH:MM:SS"
End With
.ActiveDocument.saveas "c:\Test_Create_Doc.Doc"
.Quit
End With
Set wordPara = Nothing
Set wordRng = Nothing
Set wordDoc = Nothing
Set wordApp = Nothing
End Sub