To use Word, add a refernce to Microsoft Word 9.0( or 10.0) Object Library.
Then add a Class module and add code similar to:
Public Class WordClass
Public WithEvents WordApp As Word.Application
Public Sub New()
WordApp = New Word.Application
End Sub
End Class
To get data from a datagrid into a Word document, use the original dataset
that filled the datagrid, create a Word table and populate it with code
similar to:
Dim Word As New WordClass
Dim RowCounter As Int16, ColumnCounter as Int16
' Add a blank document
Word.WordApp.Documents.Add()
' Add a table for the data to go into
Word.WordApp.Selection.Tables.Add(Range:=Word.Word App.Selection.Range,
numrows:=1, numcolumns:=6)
' Put the data from the dataset into the table
For RowCounter = 0 To ds.Tables("Table").Rows.Count - 1
For ColumnCounter = 0 to ds.Tables("Table").Columns.Count - 1
Word.WordApp.Selection.TypeText(ds.Tables("Table") .Rows(RowCounter).Item(ColumnCounter))
Word.WordApp.Selection.MoveRight(Unit:=12)
Next ColumnCounter
Next RowCounter
' Show the document
Word.WordApp.Visible = True
HTH
Helen
--
Helen
"Cor Ligthert [MVP]" wrote:
Webbyz,
If you want to make a word document, than you have to use interop (Office
has to be on the clients computer)
The information to use is forever in your underlying datasource.
Here are some links for the interop
Office
http://support.microsoft.com/default...b;EN-US;311452
http://msdn.microsoft.com/office/
Pia Download
http://www.microsoft.com/downloads/d...displaylang=en
I hope this helps,
Cor