Tag Archives: word programming in .net

Export the content of DataGridView to Word Document in vb.net

Several days past i got a comment of my user on the article ‘Create a new Word document using VB.Net‘. He was facing the trouble to export the image to Word document. He wrote his problem as: I have a Datagridview and all those three fields has been showed in the Datagridview , I have … Continue reading Export the content of DataGridView to Word Document in vb.net

Print word document programmatically in .net

  We can use can use the PrintOut method to print a Microsoft Office Word document, following example code shows how to print whole word document in vb.net and c# languages: Code Sample : [vb.net] Private Sub PrintWordDocument() Dim objWord As Word.Application Dim objDoc As Word.Document objWord = CreateObject("Word.Application") objDoc = objWord.Documents.Open("D:\Test.docx") objDoc.PrintOut() objDoc.Close() objDoc … Continue reading Print word document programmatically in .net

How to print current page of active word document in .net

  We can use can use the PrintOut method to print a Microsoft Office Word document, following example code shows how to print one copy of the current page of the word document in vb.net and c# languages: Code Sample : [vb.net] Private Sub PrintCurrentpageInWordDocument() Dim objWord As Word.Application Dim objDoc As Word.Document objWord = … Continue reading How to print current page of active word document in .net

How to find Count of total Characters in word document programmatically

  If you want to get count of total characters in any word document at run time in .net, you can use following code samples. Code Sample : [vb.net] vb.net code for finding count of characters in word document. Private Function GetCharectorsCount() As Integer Dim objWord As Word.Application Dim objDoc As Word.Document objWord = CreateObject("Word.Application") … Continue reading How to find Count of total Characters in word document programmatically

How to open existing word document in vb.net

  This example shows how to open an existing word document in vb.net. Add reference of ‘Microsoft.Office.Interop.Word’ in your project. This code example requires a document named Test.docx must exist in a D: drive. Code Sample : Private Sub OpenWordDocument() Dim objWord As Word.Application Dim objDoc As Word.Document objWord = CreateObject("Word.Application") objDoc = objWord.Documents.Open("D:\Test.docx") objWord.Visible … Continue reading How to open existing word document in vb.net

Create a new Word document and insert a table using VB.Net

  This article describes how to create a new Word document and insert a table using VB.Net, it also shows how to format tables, and populate the tables with data. follow these steps: 1. Start a new Windows application in vb.net language. 2. Add a reference to the Microsoft Word Object Library 3. Add a … Continue reading Create a new Word document and insert a table using VB.Net