hi,
your code is perfect but u've to do a small addition to the code to make it work as asked
you've to run a loop to browse thru all the records in the recordset and print it in word thats all
------------------------
VB Code Start----------------------------
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
Dim ssql As String
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Staff.mdb"
con.Open
ssql = "select Username from LoginID"
rs.Open ssql, con, adOpenDynamic, adLockOptimistic
Dim oApp As Word.Application
Dim oDoc As Word.Document
Set oApp = New Word.Application
Set oDoc = oApp.Documents.Open("Doc1.doc")
'----------Start Of Code--------------------------------
'Run a Loop To Browse Thru The Recordset, until it reaches the last recordset
Do While Not rs.EOF
oApp.Selection.TypeText Text:=rs!UserName
rs.MoveNext 'Move the Recordpointer to the next record
Loop
'----------End Of Code--------------------------------
oApp.Documents.Open ("Doc1.doc")
End Sub
-----------------------
VB Code End--------------------------
Regards,
Raghu