odd section break causes blank page

D

Don Faulkner

I have a document that is divided into several pieces "front matter" and a
main document with several chapters. I'm betting that each of these will be a
section by the time that I'm done, so I'll speak in those terms.

The first section is the title page. (1 page)
The second section is a introductory letter/abstract. (1-3 pages)
Next comes various tables (contents, figures, etc.) (2+ pages)
Next comes the first section of the main document (everything else)

The title and abstract sections (Document sections 1 and 2) should always
print single-sided. The rest of the doc may be printed duplexed
(double-sided).

So, I think, "no problem. I'll just make lots of sections and have each one
be an odd page section break." This works fine when I print the document in
duplex mode. But, sometimes, I need to print the whole doc single-sided. When
I do this, I get blank pages at the end of those sections missing a final
even page.

Now, I realize that this is happening because of the odd section break I
specified. The trouble is that the behavior is correct for duplex printing; I
want that blank page so the next section starts on an odd page--that's what
the odd break is for.

Is there a way to have my cake and eat it too? ;) How can I get a document
that prints correctly on both single-sided and duplex output? Thanks for the
help?
 
J

Jay Freedman

Hi Don,

I think you can do that. Before I get to that, though, let me ask: Is
it so hard to remove the blank pages manually from the single-sided
printout? How much trouble are you willing to go through to automate
the process?

The basic item is the field described at
http://www.word.mvps.org/FAQs/TblsFldsFms/InsEvnPgEndChap.htm. It
creates a page break only when the field lands on an odd-numbered
page. You put this field on the last line of the last page of each
section, and then start the next section with an ordinary "next page"
section break. For your purposes, the "false" part of the IF field
should contain only the page break, not the text that follows it in
the article's example.

Now, the way that field works, it always inserts a blank even page if
the section ends on an odd page. You want to be able to switch it on
or off at will. To do that, define a custom document property (in the
File > Properties > Custom dialog). Name it Duplex and make it a
Yes/No property. Then surround the existing field with an IF field
that checks the value of this property (all of this should really be
on one line):

{IF {DocProperty Duplex} = "Y"
"{IF {= MOD({Page},2)} = 0 "" "pagebreak"}" ""}

where you replace the word pagebreak with an actual Ctrl+Enter page
break. Pay attention to the instructions in the article about how to
create nested fields with the Ctrl+F9 keystroke.

Now, you can make the page breaks appear in the document by setting
the Duplex property to Yes and updating the fields. You make them
disappear by setting the property to No and updating the fields.

To avoid forgetting to change the property -- which might cause a
duplexed document to print without the extra pages, ruining the whole
run -- you need a series of macros to take care of it (see
http://www.gmayor.com/installing_macro.htm for instructions):

Public Sub FilePrint()
If SetDuplexProperty <> vbCancel Then
ActiveDocument.Fields.Update
Dialogs(wdDialogFilePrint).Show
End If
End Sub

Public Sub FilePrintDefault()
If SetDuplexProperty <> vbCancel Then
ActiveDocument.Fields.Update
ActiveDocument.PrintOut Background:=False
End If
End Sub

Public Sub FilePrintPreview()
If SetDuplexProperty <> vbCancel Then
ActiveDocument.Fields.Update
ActiveDocument.PrintPreview
End If
End Sub

Private Function SetDuplexProperty() As VbMsgBoxResult
Dim result As VbMsgBoxResult

result = MsgBox("Print duplex?", vbYesNoCancel, "Duplex")

Select Case result
Case vbYes
ActiveDocument.CustomDocumentProperties("Duplex") = True
Case vbNo
ActiveDocument.CustomDocumentProperties("Duplex") = False
Case Else
' no change
End Select

SetDuplexProperty = result
End Function


--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Tue, 1 Aug 2006 14:07:02 -0700, Don Faulkner <Don
 
D

Don Faulkner

Wow!

Thanks, Jay. I'm going to give this a try. It sounds like it will do what I
want. You're right, though: it's a lot of work. If I were only printing the
document, I wouldn't mind so much. The thing is that we also produce PDF
versions of the documents for electronic distribution, and I want to avoid
blank pages in the PDF if possible. It's all about producing a professional,
polished end product.

Hmm. Maybe I should be looking at Acrobat's features too. Maybe it has a way
to handle this.

Thanks again. I'll report my progress in a couple of days (this project is
once again on the back burner).
 
D

Don Faulkner

I just realized that there's something missing in your advice, Jay (or maybe
I'm missing it...)

I understand how the IF field creates a blank even page if necessary. What's
missing is the odd combo of duplex and non-duplex printing that I have.

The title page section is always single sided. (it's only one page, of course)
The intro letter page is also always single-sided, regardless of how many
pages it is.
The rest of the document (is|may be) duplexed.

So, can I issue one print command that gets me:
Sections 1 and 2: single-sided
Sections 3-end duplexed?
 
J

Jay Freedman

Hi Don,

Section 1 (since it's always one page) and Sections 3 to the end will
work with the setup I described. Section 2 is the problem.

The field we discussed can only add one blank page at the end of the
section, not a blank even page after every odd page -- unless you want
to put a field and a static hard page break at the end of every page
of Section 2. Since you say it's usually 3 pages or less, that might
be a solution; but it would require fiddling with page breaks and
fields every time you create a new document.

Another possible solution, if you have either a PostScript printer or
a PCL-capable printer, is to put a PRINT field in the first-page
header of Section 3. It should contain the code to turn on duplexing,
and it should be wrapped within the same kind of "IF Duplexing = Y"
field. Then you'd let Word start every print job as single-sided, and
Section 3 would start duplexing if the custom property was set to Yes.
I don't know the PostScript or PCL codes for duplexing, but they
shouldn't be hard to find.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
Top