Consulting

Results 1 to 9 of 9

Thread: Booklet order printing

  1. #1
    VBAX Tutor
    Joined
    Mar 2010
    Posts
    287
    Location

    Question Booklet order printing

    I have been researching (for what seems like an eternity) a way to generate a booklet from Word.

    I read the http://word.mvps.org/FAQs/Formatting...etPrinting.htm articles on Booklet Printing. Whenever I used the macro it would open up OneNote, and I am not familiar with it.

    The document is perfect, exactly how I want it to appear. Mirror margins, formatting, all good to go.

    The method I used to use was printing on A4 (all pages) them using an A3 photocopier to keep duplexing until I ended up with pages 1,3,5 and 7 on sheet of portrait A4. I would then copy, for example, pages 4,2,8 and 6 onto a second sheet of portrait A4. When the two pages were then photocopied 2 sided > 1 sided, I would end up with a final sheet that I could cut down the middle horizontally and vertically - producing A6 sized inserts in the correct order 1,2,3,4,5,6,7,8.

    I have found a way around this method - installing a PDF print spool (CutePDF Writer) and setting word to print 4 pages per sheet with scaling to A4. In the Page range : Pages input box I would normally type 1,3,5,7,4,2,8,6 to get the desired output.

    My document has now ballooned to 33 pages and so I was hoping to get a macro to generate this number sequence for me as I cannot type it out every time / the chance of human error is too great.

    If the macro could count the total number of pages, generate the sequence and input it into the print dialog then the entire solution would be complete, and I'd be able to upload it for use by everybody.

    (I was playing with a formula in Excel, but that was just for fun. Column A contains number 1,2,3,4,5 etc =IF(ISODD(A3),A3,IF(MOD(A3,4)=2,A3+2,A3-2)))

  2. #2
    VBAX Tutor
    Joined
    Mar 2010
    Posts
    287
    Location
    Further from last. For a 33 page document, the print order would be this :

    1,3,5,7,4,2,8,6,9,11,13,15,12,10,16,14,17,19,21,23,20,18,24,22,25,27,29,31, 28,26,32,30,33

    Producing a single A4 page containing :

    1...3
    ......
    5...7

    Followed by another A4 page containing :

    4...2
    ......
    8...6

    When copied using single sided to double sided, the resultant single page can be cut into 4 with perfect page numbering for a booklet.

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,727
    Location
    Not sure about the actual production, but MS Word (2010 at least) can save as a PDF

    If you saved it in PDF you can use Adobe Reader's booklet printing options

    I've always had pretty good luck doing it that way

    You might have to adjust your document a little
    Attached Images Attached Images
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  4. #4
    VBAX Tutor
    Joined
    Mar 2010
    Posts
    287
    Location
    The issue is - I don't actually want to print it. I wan't to create a PDF that I can distribute to an end user who can simply print it, then do the 1 sided to 2 sided photocopying. This requires me to produce a single PDF with pages in montage in the correct order.

    It is just the number sequence I am stuck on, hoping a macro could help?

  5. #5
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,727
    Location
    Try to use Adobe Reader's [Print] in Booklet Mode to print to CutePDF and see if that works for you
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  6. #6
    VBAX Tutor
    Joined
    Mar 2010
    Posts
    287
    Location
    Quote Originally Posted by Paul_Hossler View Post
    Try to use Adobe Reader's [Print] in Booklet Mode to print to CutePDF and see if that works for you
    That is a step further than I was hoping to go. Effectively, I want to be able to click "Export doc as booklet".

    I have the pdf print spool connected and working, so just need a code to generate the correct page sequence. In Pseudocode it's simple :

    Generate 4 odd numbers, in correct order
    Generate 4 even numbers, switching the pairs

    Continue the sequence - effectively jumping 8 in the sequence, starting at 1 (add 4 odd) (add 4 even), next sequence starts at 9.

  7. #7
    VBAX Contributor
    Joined
    Oct 2012
    Location
    Brisbane, Queensland, Australia
    Posts
    163
    Location
    The following code will generate a string containing the numbers of the pages in the required order and print out the document:

    Dim i As Long
    Dim strpages As String
    Dim numpages As Long
    numpages = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
    For i = 1 To numpages Step 8
        strpages = strpages & "," & i & "," & i + 2 & "," & i + 4 & "," & i + 6 & "," & i + 3 & "," & i + 1 & "," & i + 7 & "," & i + 5
    Next I
    strpages = Mid(strpages, 2)
    ActiveDocument.PrintOut Range:=wdPrintRangeofPages, Pages:=strpages
    If the length of strpages exceeds 255 characters, it will be necessary to split it into two and then do the print in two parts

  8. #8
    VBAX Tutor
    Joined
    Mar 2010
    Posts
    287
    Location
    Quote Originally Posted by Doug Robbins View Post
    The following code will generate a string containing the numbers of the pages in the required order and print out the document:

    Dim i As Long
    Dim strpages As String
    Dim numpages As Long
    numpages = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
    For i = 1 To numpages Step 8
        strpages = strpages & "," & i & "," & i + 2 & "," & i + 4 & "," & i + 6 & "," & i + 3 & "," & i + 1 & "," & i + 7 & "," & i + 5
    Next I
    strpages = Mid(strpages, 2)
    ActiveDocument.PrintOut Range:=wdPrintRangeofPages, Pages:=strpages
    If the length of strpages exceeds 255 characters, it will be necessary to split it into two and then do the print in two parts
    Awesome, thank you very much! I was thinking of using MOD 4 (being pages per page) and then applying rules based on a count (i) to apply treatment. This is much simpler and clearer.

    I'll test and get back to you.

  9. #9
    VBAX Tutor
    Joined
    Mar 2010
    Posts
    287
    Location
    I have produced a script that runs a sequence. Any thoughts on improving the efficiency or changing the approach?

    Function strBookletOrder()
    
    
    Dim i As Integer
    Dim neg As Integer
    Dim pos As Integer
    
    
    last = 33 'Temp last page
    
    
    i = 1   'Start counter
    neg = 1 'neg aggreator
    pos = 2 'pos aggregator
    
    
    Do
        If ((i - 1) Mod 4) Mod 2 = 0 Then
            'Odd sequence
            For neg = neg To (neg + 6) Step 2
                Debug.Print neg
                If neg = last Then Exit Do
            Next neg
        Else
            'Even sequence
            For pos = pos To (pos + 6) Step 2
                    If pos Mod 4 Then
                        Debug.Print pos + 2
                    Else
                        Debug.Print pos - 2
                    End If
                If pos = last Then Exit Do
            Next pos
        End If
    i = i + 1
    Loop
    
    
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •