Microsoft Office Tutorials and References
In Depth Information
Creating Word Labels from an Excel Recipient List
'Only one page is created so far.¶
'Now, copy the same page¶
'(with label structure in it) the necessary¶
'number of times for page count calculated above.¶
With .Selection¶
.WholeStory¶
.Copy¶
For i = 1 To lngPage - 1¶
'wdStory = 6¶
.HomeKey 6¶
.InsertBreak 7¶
.HomeKey 6¶
.Paste¶
Next i¶
End With¶
End With¶
'Processed job count so far¶
j = 3¶
i = 0¶
intLabelRow = 1¶
tblIndex = 1¶
'Loop through Excel data range¶
For Each objRow In objRng.Rows¶
DoEvents¶
'Increment processed job count¶
j = j + 1¶
Call UpdateProgressBar("Printing labels for : " & _¶
objRow.Cells(1, 1).Value, j * sngUnitWidth)¶
'Validate if quantity cell doesn't include a numeric value¶
If IsNumeric(objRow.Offset(, 6)) Then¶
'Fill necessary number of selected row in data range¶
'column 6 - column G shows the total necessary label count¶
'to print for the corresponding name in the sample code¶
For i = i To objRow.Offset(, 6) - 1 + i¶
'Check if user closed the form¶
'and exit application if requested¶
'otherwise continue until all¶
'labels are created even if form is closed¶
If blnUserCancel Then¶
With objApp¶
.Selection.HomeKey 6¶
.Visible = True¶
End With¶
Exit Sub¶
End If¶
j = j + 1¶
Call UpdateProgressBar("", j * sngUnitWidth)¶
Cmb
Search JabSto ::




Custom Search