Export Data from Visual Basic .Net 2008 to Microsoft Word

Dim objWordApp As Object
Dim objWordDoc As Object

objWordApp = CreateObject(“Word.Application”)
objWordDoc = objWordApp.documents.add()
objWordDoc.tables.add(objWordDoc.range(0, 0), 11, 3)

With objWordDoc.tables(1)   
    .borders.InsideLineStyle = 1
.borders.OutsideLineStyle = 1 

    For i As Integer = 0 To 10
.rows(i + 1).cells(1).range.text = Me.dgvData.Rows(i).Cells(“id”).Value 
.rows(i + 1).cells(2).range.text = Me.dgvData.Rows(i).Cells(“name”).Value
       .rows(i + 1).cells(3).range.text =
NextEnd With

objWordApp.visible = True
objWordApp =




2 Responses to “Export Data from Visual Basic .Net 2008 to Microsoft Word”

  1. ថុនា Says:

    មិនយល់ទេ ។ មិនដឹងស្អីផង!

    • sethaiech Says:

      មានស្អី! វាជាភាសាកុំព្យូទ័រសម្រាប់អ្នកសិក្សាព័ត៌មានវិទ្យាតើ!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: