Private Sub CommandButton1_Click()
Dim ObjDoc As bpac.Document
Set ObjDoc = CreateObject("bpac.Document")
ObjDoc.Open (ActiveWorkbook.Path &
"\固定资产名称.lbx")
Dim str As String
For r = 1 To Selection.Areas(1).Rows.Count
Dim i As Integer
i = Selection.Areas(1).Cells(r, 1).Row
ObjDoc.GetObject("Name").Text = Cells(i, 3).Text
ObjDoc.GetObject("Section").Text = Cells(i, 4).Text
ObjDoc.GetObject("Number").Text = Cells(i, 5).Text
ObjDoc.GetObject("QR条码1").Text = Cells(i, 5).Text
ObjDoc.StartPrint "DocumentName", bpoAutoCut
ObjDoc.PrintOut 1, bpoAutoCut
ObjDoc.EndPrint
Next
ObjDoc.Close
Set ObjDoc = Nothing
End Sub