Using a Button to Print checked Checkboxes

S

Simon IPA

I've created a set of bookmarks that relate to areas on table (adhesive
labels). If I create check boxes associated with the bookmarks can I add a
button that will print the checked bookmarks. I can get this to work with one
check box but not multiple ones as it will only select one at a time. sorry
I've no idea about programming and just use the record function.

Private Sub CommandButton1_Click()

If CheckBox1.Value = True Then
ActiveDocument.Bookmarks("Range1").Select

Application.PrintOut FileName:="", Range:=wdPrintSelection, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0

End If
End Sub
 
D

Doug Robbins - Word MVP

What are you really trying to do? The way you are heading, you would be
printing individual labels scattered all over the sheet.

You probably should be using mail merge and apply a filter to the data
source to restrict the records that are merge to those for which you want to
create labels.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 
S

Simon IPA

Thanks but the labels i want to print are sets. I have 9 sets on each page of
labels however may only want to print 2 sets on one day. I would like to be
able to use the same page again but print say another 3 sets from the unused
labels remaining on the page. Mail merge can do this ?
 
D

Doug Robbins - Word MVP

Using this macro, it can

Macro to set the first label on a part sheet of labels for a label type
mailmerge.
Dim MMMDoc As Document
Dim dsource As Document
Dim dtable As Table
Dim i As Long, j As Long
Set MMMDoc = ActiveDocument
With MMMDoc.MailMerge
If .MainDocumentType = wdMailingLabels Then
If .State = wdMainAndDataSource Then
Set dsource = Documents.Open(.DataSource.Name)
Set dtable = dsource.Tables(1)
i = InputBox("Enter the number of labels that have already been
used on the sheet.", "Set Starting Label")
If IsNumeric(i) Then
With dtable
For j = 1 To i
.Rows.Add BeforeRow:=.Rows(2)
Next j
End With
End If
.Destination = wdSendToNewDocument
.Execute
End If
End If
End With
dsource.Close wdDoNotSaveChanges


--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top