PDA

View Full Version : Print every 2 pages



clmowers
01-10-2008, 12:52 PM
hello everyone, Im hoping someone can help me with this. I need to create a macro or something and i dont know VBA at ALL!!!. What i need to do is print 2 pages then skip 2 pages then printer 2 pages and so on. There is over a 1000 pages that i need to do this with. Then once those are printeed i need another to print the one that were not printed. Does anyone have any clue on how to do this

TonyJollans
01-11-2008, 05:29 AM
Something like this ...


Dim First As Long, Max As Long

For First = 1 To Max Step 4
Application.PrintOut Range:=wdPrintRangeOfPages, _
Pages:=First & "-" & First + 1
Next
For First = 3 To Max Step 4
Application.PrintOut Range:=wdPrintRangeOfPages, _
Pages:=First & "-" & First + 1
Next

clmowers
01-11-2008, 06:52 AM
Thanks for the response, Would i place this in a Macro? I tried to use that code and nothing happened. Im not sure what im doing wrong

lucas
01-11-2008, 07:12 AM
You will have to enclose it in sub/end sub tags like this:
Sub print2pages()
Dim First As Long, Max As Long

For First = 1 To Max Step 4
Application.PrintOut Range:=wdPrintRangeOfPages, _
Pages:=First & "-" & First + 1
Next
For First = 3 To Max Step 4
Application.PrintOut Range:=wdPrintRangeOfPages, _
Pages:=First & "-" & First + 1
Next
End Sub

insert it in a standard module....If you don't know how..check this (http://xlvba.3.forumer.com/index.php?showtopic=361) out. Once you have your project explorer showing go to insert-module in the vbe to insert a standard module...paste the code above into that module and run it from there.

clmowers
01-15-2008, 10:05 AM
Ok, I created a new modual and inserted that code into the modual. I tried to run it and it still doesnt work. I have no clue why. I dont know if it makes a differance, but this is printing out of word 2003. Sorry for being such a pain. Thanks

TonyJollans
01-15-2008, 11:19 AM
What happens when it runs?

fumei
01-15-2008, 02:55 PM
"Ok, I created a new modual and inserted that code into the modual. I tried to run it and it still doesnt work. "

WHERE did you create this module?
WHAT Project?
HOW did you try and run it?

clmowers
01-16-2008, 05:56 AM
WHERE did you create this module?, i opened vb editor and then under the normal, i did a insert modual.

WHAT Project? Under normal

WHAT Project? From both the macro screen and the vb screen

What happens when it runs? it doesnt do anything, no error or anything, you hit the play button and it just sits there. Sorry for being so stubborn on this, but i have never used VBA in word before, and don't know a thing of VBA

TonyJollans
01-16-2008, 10:38 AM
Oops! Sorry.

You need to pick up the number of pages in the document:


Sub print2pages()
Dim First As Long, Max As Long

Max = ActiveDocument.Range.Information(wdActiveEndAdjustedPageNumber)

For First = 1 To Max Step 4
' etc. as before