Sub insertbarcodefield(ByVal barcodetext As String) Selection.Collapse Direction:=wdCollapseStart Set myField = ActiveDocument.Fields.Add(Range:=Selection.Range, Type:=wdFieldEmpty, text:=barcodetext) End Sub Sub makebarcodetextsize(ByVal text As String, ByVal barcodetype As String, ByVal size As Integer) insertbarcodefield "DISPLAYBARCODE """ + text + """ " + barcodetype + " \t \h " + Str(size) + "" End Sub Sub dobarcodes() barcodestring = InputBox$("Barcode String") For i = 400 To 1500 Step 100 makebarcodetextsize ltrim(Str(i)), "code128", i Selection.TypeParagraph makebarcodetextsize "a" + barcodestring + "a", "nw7", i Selection.TypeParagraph Next End Sub
No comments:
Post a Comment