Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-02-2013, 06:56 PM
macropod's Avatar
macropod macropod is offline Numbering labels prints Windows 7 32bit Numbering labels prints Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

OK, what I'd suggest is creating a plain template with the following macro in it:


Code:
Sub PrintMe()
Application.ScreenUpdating = False
Dim iStart As Long, iEnd As Long, iCount As Long, StrPages As String
On Error GoTo Done
With ActiveDocument
  iStart = .Sections.First.Headers(wdHeaderFooterPrimary).PageNumbers.StartingNumber
  If iStart = 0 Then iStart = 1
  iStart = InputBox("What is the First Number?", "Numbering Start From", iStart)
  iEnd = InputBox("What is the Last Number?", "Numbering Stop At", iStart)
  If IsNumeric(iStart) = False Or IsNumeric(iEnd) = False Then GoTo Done
  If iStart > iEnd Or iEnd = 0 Then GoTo Done
  iCount = iEnd - iStart
  If Len(.Range.Text) > 1 Then
    With .Styles("Page Number").Font
      .Size = 16
      .Name = "Arial"
      .Bold = True
    End With
    .Range.Cut
    With .Sections.First.Headers(wdHeaderFooterPrimary)
      .Range.Paste
      With .PageNumbers
        .Add PageNumberAlignment:=wdAlignPageNumberRight, FirstPage:=True
        .RestartNumberingAtSection = True
        .StartingNumber = iStart
      End With
    End With
  End If
  For iCount = iStart To iEnd - 1
    StrPages = StrPages & Chr(12)
  Next iCount
  .Range.InsertAfter StrPages
  With Application.Dialogs(wdDialogFilePrint)
    If .Show <> True Then iEnd = iStart - 1
  End With
  .Range.Delete
  .Sections.First.Headers(wdHeaderFooterPrimary).PageNumbers.StartingNumber = iEnd + 1
End With
Done:
Application.ScreenUpdating = True
End Sub
(we can modify the wording etc. to meet your needs)

Then, whenever you get one of these labels generated by the external program, simply go to Developer|Document template and attach your template. If you then run the 'PrintMe' macro, that will take care of moving the content into the header and generating the pages. As written, the code allows you to re-use the document later on, though you will need to re-save it after attaching the template (which you only need do once) to keep the template attached.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 12-03-2013, 10:51 AM
valeriab valeriab is offline Numbering labels prints Windows XP Numbering labels prints Office 2007
Novice
Numbering labels prints
 
Join Date: Nov 2013
Posts: 5
valeriab is on a distinguished road
Default

hello Paul, thanks! I will test this first thing tomorrow morning and let you know. Thanks, kind regards Valeria
Reply With Quote
  #3  
Old 12-19-2013, 08:00 AM
valeriab valeriab is offline Numbering labels prints Windows XP Numbering labels prints Office 2007
Novice
Numbering labels prints
 
Join Date: Nov 2013
Posts: 5
valeriab is on a distinguished road
Default

Hello Paul, again, sorry for this very late reply. I was able to test the macro today only in the end; it works very well for most labels except for a couple where it deletes almost everything, like the one I have attached (all the ones not working that I have found are the ones with the big symbol on the right if it can help). I am not good enough to understand why....
A second question is how to change the position of the numbering to the bottom left-hand side...

Again many thanks!
Best regards
Valeria
Attached Files
File Type: docx ex label 5 NOT OK.docx (47.0 KB, 13 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Numbering labels prints Prints in half page landscape lostsoul62 Excel 2 07-22-2013 01:24 PM
Numbering labels prints Printing Issue - What is see in preview is not what actually prints - PLEASE HELP!!! clariberry Word 2 05-03-2012 10:42 AM
Numbering labels prints VBA Print Command Prints Document Twice HorizonSC Word 2 11-15-2011 03:26 AM
word only prints pictures AidyTy Word 0 12-15-2009 01:50 PM
Footer so low on page only top half prints Renee Hendershott Word 1 01-22-2006 05:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft