PowerPoint
Barcodes with VBA

VBA Examples

Using and automate barcodes with VBA in PowerPoint

1

You can easily solve many things with VisualBasic for Applications (VBA). Here we show you briefly, how to integrate the barcode object into a PowerPoint presentation using VBA, use it, and remove it again:

This is how to insert the ActiveBarcode Control into the active slide using VBA:
In this example, the barcode is placed at the specified position and size into the slide. The object can then be addressed via "ab":

Dim ab As Shape
Set ab = Application.ActiveWindow.View.Slide.Shapes.AddOLEObject(Left:=100,
Top:=100, Width:=300, Height:=150, ClassName:="BARCODE.BarcodeCtrl.1")
Now you can change the standard properties (e.g. height, width) of the OLE object using the properties of the variable "ab":
ab.Width = 200
ab.Height = 120
You can access the properties and methods of the barcode object using the "OLEFormat.Object" property. Here are a few examples:
ab.OLEFormat.Object.Type = 6
ab.OLEFormat.Object.Text = "987698769812"
ab.OLEFormat.Object.Rotate = 90
If you no longer need the control within the macro/slide (for example, after printing), you can easily remove it:
 ab.Delete
Hint: Should it be necessary for Windows to process pending events in a macro in between (often also called "KeepWindowsAlive"), you can force this by using the following VBA function:
DoEvents
This may be necessary, for example, if the control needs to redraw itself.


| Home | Shop | Download | E-Mail | Privacy Policy | Imprint | Version 6.7.0
Copyright ©
Frank HornActiveBarcode Generator
Web design: szBubble 3.2.3.358
Copyright © Frank Horn
&
Lars SchenkActiveBarcode Object
Web- & server component
Command line
Copyright © Lars Schenk

All trademarks and product names mentioned are the property of their respective owners.



We use cookies to provide you with the best experience and functionality on our website. By using our site you agree to this. read more >