Results 1 to 5 of 5

Thread: [Resolved]Printing Specific range of Pgs.-Word 2000[Resolved]

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    3

    [Resolved]Printing Specific range of Pgs.-Word 2000[Resolved]

    I have a 60,000 page Word 2000 document. There are 7,500 people who need four double sided pages printed front and back and then stapled.
    What I want to do is send the file to my copier and have the pages individually printed and stapled for each of the 7,500 people. What I would like to do is create a macro that will send the first 8 pages and then the next 8 pages and so on. I have to do it this way because I can not send the entire document and have the copier staple each 8 pages by themselves, it would try to staple the whole document, which obviously wouldn't be possible nor is it what I want. Is there a way to do this in a Macro, such as using WdPrintFromTo? Or similar?
    Thanks.
    Last edited by jpmhughes; Aug 26th, 2004 at 02:17 PM.
    Jim

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    3

    Someones solution at another forum

    At another forum someone suggested this in VB:

    Sub PrintEight()
    Dim J As Long

    For J = 1 To 60000 Step 8
    ActiveDocument.ActiveWindow.PrintOut _
    Range:=wdPrintFromTo, From:=J, To:=J + 7
    Next J
    End Sub

    It looks good but doesn't work.
    I get a Run time error -13
    Type mismatch
    at:
    ActiveDocument.ActiveWindow.PrintOut _
    Range:=wdPrintFromTo, From:=J, To:=J + 7

    I am very new to this (first time) can anyone help?
    Thanks,
    Jim
    Jim

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    You need to place double quotes around the from and to values.
    But since you are using a variable, use CStr() function.
    They are of string type.

    VB Code:
    1. Sub PrintEight()
    2.     Dim J As Long
    3.    
    4.     For J = 1 To 60000 Step 8
    5.         ActiveDocument.ActiveWindow.PrintOut Range:=wdPrintFromTo, From:=CStr(J), To:=CStr(J + 7)
    6.     Next J
    7. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    3

    Thank YOu

    That worked. Much appreciated.
    Jim

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    No prob.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width