R
RacinMyLancer
I am having trouble telling the Printout method (VBA, MS Word 2002) to print
specific SECTIONS of my document only. I have attempted several different
techniques and have concluded that the method has trouble interpreting page
ranges... although I would be glad to find out that I am mistaken.
So: I have a document with 4 sections, page numbers as follows: s1(3),
s2(3), s3(1), s4(1).
I employ the following line of code:
,where vPrintRangeLower and vPrintRangeHigher are defined as the upper and
lower page ranges of my document. In this case, they are set to 1 and 3, for
the first section of the document.
The result is, the ENTIRE 8 page document prints out.
So I set my ranges to 4-6, to print the second section... the result is the
same... the ENTIRE document prints out.
I also attempted the following line of code, bypassing 'wdPrintFromTo':
,where M=the current section, ie. 1,2, so that the print ranges read "s1",
"s2", etc.
The result is exactly the same. The entire document prints out. The
PrintOut method works perfectly for me in documents that are not divided into
sections, so my conclusion is either that the PrintOut method is not capable
of properly interpreting and handling sections, OR... there's something I'm
doing wrong.
I would REALLY love some input. Thanks in advance.
specific SECTIONS of my document only. I have attempted several different
techniques and have concluded that the method has trouble interpreting page
ranges... although I would be glad to find out that I am mistaken.
So: I have a document with 4 sections, page numbers as follows: s1(3),
s2(3), s3(1), s4(1).
I employ the following line of code:
Code:
ActiveDocument.PrintOut Background:=True, Range:=wdPrintFromTo,
From:=vPrintRangeLower, To:=vPrintRangeHigher, Copies:=1
,where vPrintRangeLower and vPrintRangeHigher are defined as the upper and
lower page ranges of my document. In this case, they are set to 1 and 3, for
the first section of the document.
The result is, the ENTIRE 8 page document prints out.
So I set my ranges to 4-6, to print the second section... the result is the
same... the ENTIRE document prints out.
I also attempted the following line of code, bypassing 'wdPrintFromTo':
Code:
ActiveDocument.PrintOut Background:=True, Pages:="s" & M, Copies:=1
"s2", etc.
The result is exactly the same. The entire document prints out. The
PrintOut method works perfectly for me in documents that are not divided into
sections, so my conclusion is either that the PrintOut method is not capable
of properly interpreting and handling sections, OR... there's something I'm
doing wrong.
I would REALLY love some input. Thanks in advance.