Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Printing File Folder labels when Sheet not full

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
StephenW - 21 Sep 2007 20:52 GMT
I have a macro that does a mail merge to create file folder labels.  How can
I tell Word where to start printing the labels when the sheet is not a full
sheet of labels?

Thanks
Doug Robbins - Word MVP - 22 Sep 2007 08:14 GMT
If the data source is a table in a Word document, the following macro will
temporarily add the required number of blank records into the data source so
that the first label prints on the label that you specify.

'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

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a macro that does a mail merge to create file folder labels.  How
>can
[quoted text clipped - 3 lines]
>
> Thanks
StephenW - 24 Sep 2007 15:00 GMT
Doug,
Thanks for the response.  But my data source is not in a table, but simply a
Ascii comma delimited list.  Do I just need to add blank records at the top
of my list for the labels that have been used?
Steve

> If the data source is a table in a Word document, the following macro will
> temporarily add the required number of blank records into the data source so
[quoted text clipped - 35 lines]
> >
> > Thanks
Doug Robbins - Word MVP - 29 Sep 2007 06:34 GMT
Yes, but the blank records will need to have the requisite number of commas
to prevent Word from erroring our with a too few fields error message.

Alternatively, use the existing datasource with a catalog, or in later
versions of Word it is called directory, type mail merge in the main
document of which you insert a one row table with the fields names in the
cells of that table.  Then when you execute that merge to a new document, it
will contain a row of data for each record in the datasource.  You can then
insert a row at the top of the table into which you insert the merge field
names and use that as the data source.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Doug,
> Thanks for the response.  But my data source is not in a table, but simply
[quoted text clipped - 46 lines]
>> >
>> > Thanks
Graham Mayor - 29 Sep 2007 06:48 GMT
It would make things simpler if you converted the comma delimted file to a
table - see http://www.gmayor.com/convert_labels_into_mail_merge.htm

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Doug,
> Thanks for the response.  But my data source is not in a table, but
[quoted text clipped - 50 lines]
>>>
>>> Thanks

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.