// Load the word document
Document wordDocument = new Document("Invitation.doc");
// get all the shapes
NodeCollection shapes = wordDocument.GetChildNodes(NodeType.Shape, true, false);
// loop through all the shapes
foreach (Shape shape in shapes)
{
// check if it has an image
if (shape.HasImage)
{
// save the image in memory stream
MemoryStream imgStream = new MemoryStream();
shape.ImageData.Save(imgStream);
// recognize the barcode from the image stream above
BarCodeReader reader = new BarCodeReader(new Bitmap(imgStream), BarCodeReadType.Code39Standard);
while(reader.Read())
{
Console.WriteLine("Codetext found: " + reader.GetCodeText());
}
// close the reader
reader.Close();
}