View Single Post
  #2   Report Post  
Posted to microsoft.public.word.pagelayout
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default odd section break causes blank page

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/TblsFl...nPgEndChap.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 FAQ: http://word.mvps.org
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
wrote:

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?