Independentsoft
Home
Products
Purchase
Support
Downloads
Company
Contact
Word .NET
>
Tutorial
> Hello Word
The following example shows you how to create simple document with text "Hello Word!".
C# example
using System; using Independentsoft.Office.Word; namespace Sample { class Program { static void Main(string[] args) { WordDocument doc = new WordDocument(); Run run = new Run(); run.AddText("Hello Word!"); Paragraph paragraph = new Paragraph(); paragraph.Add(run); doc.Body.Add(paragraph); doc.Save("c:\\test\\output.docx", true); } } }
VB example
Imports System Imports Independentsoft.Office.Word Module Module1 Sub Main(ByVal args() As String) Dim doc As WordDocument = New WordDocument() Dim run As Run = New Run() run.AddText("Hello Word!") Dim paragraph As Paragraph = New Paragraph() paragraph.Add(run) doc.Body.Add(paragraph) doc.Save("c:\test\output.docx", True) End Sub End Module