Barcode for .NET Suite
How to Generate Barcodes in Word using C#
How to create, insert various barcode images in Microsoft Word using Visual C#
Word Barcode Integration > Barcode in C#
KA.Barcode for .NET Suite is a powerful and easy to use barcode generator library SDK, which can help you generate, print accurate barcode images in commonly-used projects, like Microsoft Excel Workbook, Microsoft Word Document, ASP.NET web application, Windows Forms, C# / VB.NET Class Library, to name just a few.
Furthermore, KeepAutomation also provides easy-to-use Word barcode generator addin/plugin, designed for barcode generation with no programming revolved or barcode fonts needed. Please click here to view how to generate barcodes in Word document with generator addin.
Compatibility & Requirements

Development Environments

  • For Visual studio 2005/2008/2010
  • Visual C#, Visual Basic.NET, Borland Delphi, etc

OS Compatibility:

  • Operating Systems with Microsoft .NET Framework 2.0 or above
Test Environment:
  • Microsoft Windows XP
  • Microsoft Visual Studio 2008
  • Visual C#.NET
  • Microsoft Office Word 2007
Free to Download Control Demo Package:
Click to download Barcode Generator for .NET Suite trial version free
Install & Add Reference
  1. 1.
    Unzip the trial package to get two dlls: "KeepAutomation.Barcode.Windows.dll" & "KeepAutomation.Barcode.Web.dll"
  2. 2.
    Add either of the components to reference by clicking "Project" and select "Add Reference"
  3. 3.
    Please click "Browse" to locate either one of the above two controls and click "OK"
  4. 4.
    Now the control has been successfully added to your reference
How to Generate Barcodes in Word Using C#
  1. 1.
    Create a new project in C# by selecting Word Document in Office Project Type
  2. 2.
    In the left-side Toolbox, drag a PictureBox into the created Word document
  3. 3.
    Double click the picture box, and you will be shifted to a Form1 for programming
  4. 4.
    Copy the Visual C# sample code below to your C#.NET barcode program
  5. 5.
    Run the project and the barcode image will display in the Word document in PictureBox
  6. 6.
    Note: Make sure you have installed VS supported version of MS Word in advance
private void pictureBox1_Click(object sender, EventArgs e)
BarCode barcode = new BarCode();

barcode.Symbology = KeepAutomation.Barcode.Symbology.DataMatrix;
barcode.CodeToEncode = "BarcodeGenerator";
barcode.DataMatrixDataMode = DataMatrixDataMode.Auto;
barcode.DataMatrixFormatMode = DataMatrixFormatMode . FM_10*10;

barcode.DPI = 72;
barcode.X = 3;
barcode.Y = 3;
barcode.LeftMargin = 3;
barcode.RightMargin = 3;
barcode.TopMargin = 3;
barcode.BottomMargin = 3;

Bitmap bmp = barcode.drawBarcode();

this.pictureBox1.Image = bmp;