Tag Archives: Office Programming

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

Example to create an e-mail message in Outlook.

  This example shows how to create an e-mail message in Outlook. Private Sub CreateMailItem() Dim objItem As Outlook.MailItem = _ Me.CreateItem(Outlook.OlItemType.olMailItem) objItem.Subject = "Hello Author" objItem.To = "aboutus@authorcode.com" objItem.Body = "Hello Author, i want to contact you" objItem.Importance = Outlook.OlImportance.olImportanceLow objItem.Display(False) End Sub

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 using VB.Net

  This article describes how to create a new Word document using VB.Net. 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 button to Form1 from Toolbox. 4. Double-click Button1, create a Button click event. 5. Write code on … Continue reading Create a new Word document using VB.Net

Create a new Word document and insert a table in c#

  This article describes how to create a new Word document and insert a table using c#, it also shows how to format tables, and populate the tables with data. follow these steps: 1. Start a new Windows application in C# 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 in c#

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