Kindly help.
Dim i As Long
With ActiveDocument
For i = 1 To .Sections.Count
.PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" & i
Next i
End With
That will send each letter to the printer as a separate print job and hence
the duplexing will work correctly.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"S N" <uand...@yahoo.com> wrote in message
news:#ER5uq7j...@TK2MSFTNGP02.phx.gbl...
"Doug Robbins - Word MVP" <d...@REMOVECAPSmvps.org> wrote in message
news:EFDFCCA5-3477-4C42...@microsoft.com...
So how many Sections per letter are there? With that information, you could modify the macro print groups of Sections.
An alternative approach is to place the following field code at the very end of the last Section in your mailmerge main document:
{=MOD({PAGE},2) \# "{QUOTE 12};;"}
What this will do is to insert a page break if the page on which it occurs is an odd-numbered page.
Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.
--
Cheers
macropod
[Microsoft MVP - Word]
"S N" <uand...@yahoo.com> wrote in message news:u4IaQ$RkKHA...@TK2MSFTNGP02.phx.gbl...
Dim i As Long
Dim iSect As Integer
iSect = InputBox("How many sections were there in the merge source
document?", _
"Split Merge To Printer", "1")
With ActiveDocument
For i = 1 To .Sections.Count Step iSect
.PrintOut Range:=wdPrintFromTo, _
From:="s" & i, _
To:="s" & i + iSect - 1
Next i
End With
Input the number of sections in the original document.at the prompt.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
"S N" <uand...@yahoo.com> wrote in message
news:u4IaQ$RkKHA...@TK2MSFTNGP02.phx.gbl...
I am trying the code given in a new document having single page (modified QUOTE 12 to QUOTE 1).
Still I am getting the following error message and the resulting document still contains only one page after print.
!Missing Operator
Please help
Â
"Graham Mayor" <gma...@REMOVETHISmvps.org> wrote in message
news:%23OAReMS...@TK2MSFTNGP05.phx.gbl...
Still I am getting the following error message and the resulting document
still contains only one page after print.
!Missing Operator
Please help
"Graham Mayor" <gma...@REMOVETHISmvps.org> wrote in message
news:%23OAReMS...@TK2MSFTNGP05.phx.gbl...
The above is the error that appears when I copy the code given by macropod
at the end of the 11 page document and run print.
"S N" <uand...@yahoo.com> wrote in message
news:%23qPAHcS...@TK2MSFTNGP06.phx.gbl...
This is absurd.
Please help.
"macropod" <macr...@invalid.invalid> wrote in message
news:eXOKwFSk...@TK2MSFTNGP02.phx.gbl...
1. Don't change QUOTE 12 to QUOTE 1. The "12" means insert character
code 12, which is a page break.
2. Although I have been unable to generate a "!Missing operator" error
here (macropod may well be able to think of a reason why when he next
sees your message), things that might cause a syntax error include:
a. each pair of {} need to be the special field code braces that you
can insert using ctrl-F9. You can't just type them using the keyboard
b. If you have section formatting that outputs the result of { PAGE }
as anything other than a number (1,2,3), then the syntax may be wrong,
or there could be nother type of error. e.g. if your page numbers are
set up to be - 1 -,- 2 -, or A,B,C. In the unlikely event that you are
using chapter-page numbering, you may not get a syntax error but the MOD
calculation might be wrong, e.g. if you have 1-1, MOD will treat it as zero.
b. if your regional options (in Control Panel) are set up to use a
"List separator" that is not "," you will need to use that List
separator, e.g.
{=MOD({PAGE};2)}
instead of
{=MOD({PAGE},2)}
Peter Jamieson
On 07/01/2010 12:10, S N wrote:
> I am trying the code given in a new document having single page
> (modified QUOTE 12 to QUOTE 1).
>
> Still I am getting the following error message and the resulting
> document still contains only one page after print.
>
> !Missing Operator
>
> Please help
>
> "macropod" <macr...@invalid.invalid <mailto:macr...@invalid.invalid>>
> wrote in message news:eXOKwFSk...@TK2MSFTNGP02.phx.gbl...
> > Hi SN,
> >
> > So how many Sections per letter are there? With that information, you
> could modify the macro print groups of Sections.
> >
> > An alternative approach is to place the following field code at the
> very end of the last Section in your mailmerge main document:
> > {=MOD({PAGE},2) \# "{QUOTE 12};;"}
> > What this will do is to insert a page break if the page on which it
> occurs is an odd-numbered page.
> >
> > Note: The field brace pairs (ie '{ }') for the above example are
> created via Ctrl-F9 - you can't simply type them or copy & paste
> > them from this message.
> >
> > --
> > Cheers
> > macropod
> > [Microsoft MVP - Word]
> >
> >
> > "S N" <uand...@yahoo.com <mailto:uand...@yahoo.com>> wrote in
> message news:u4IaQ$RkKHA...@TK2MSFTNGP02.phx.gbl...
> >> The solution is not working.
> >> Probably the problem is that the original single document also
> contains many sections. Hence the macro is splitting the document
> >> itself into many separate print documents, sometimes even when there
> is no section breaks between them.
> >> Please help with alternative solution.
> >>
> >>
> >>
> >> "Doug Robbins - Word MVP" <d...@REMOVECAPSmvps.org
> <mailto:d...@REMOVECAPSmvps.org>> wrote in message
> news:EFDFCCA5-3477-4C42...@microsoft.com...
> >>> Execute the merge to a new document, and then use a macro
> containing the following code to do the printing
> >>>
> >>> Dim i As Long
> >>> With ActiveDocument
> >>> For i = 1 To ..Sections.Count
> >>> ..PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" & i
> >>> Next i
> >>> End With
> >>>
> >>> That will send each letter to the printer as a separate print job
> and hence the duplexing will work correctly.
> >>>
> >>> --
> >>> Hope this helps.
> >>>
> >>> Please reply to the newsgroup unless you wish to avail yourself of my
> >>> services on a paid consulting basis.
> >>>
> >>> Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
> >>>
> >>> "S N" <uand...@yahoo.com <mailto:uand...@yahoo.com>> wrote in
DO NOT change 'QUOTE 12' to 'QUOTE 1'! The 'QUOTE 12' tells Word to insert a page break.
As for your page numbering, issue, try doing a print preview before printing. If that doesn't work, post back and I'll give you a
field code to suppress the page number on the last page.
--
Cheers
macropod
[Microsoft MVP - Word]
"S N" <uand...@yahoo.com> wrote in message news:OZgAeqSk...@TK2MSFTNGP02.phx.gbl...
{ IF { PAGE } < 12 "{ page } of { numpages }" "" }
That will suppress the page numbering on page 12.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"S N" <uand...@yahoo.com> wrote in message
news:OZgAeqSk...@TK2MSFTNGP02.phx.gbl...
"macropod" <macr...@invalid.invalid> wrote in message
news:%23gTSugW...@TK2MSFTNGP04.phx.gbl...
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"S N" <s...@invalid.invalid> wrote in message
news:OJfqFeck...@TK2MSFTNGP04.phx.gbl...
For a single-Section letter, that's easy. But you've described your mailmerge as using multi-Section letters. Is there any way you
can reduce the # Sections per letter to 1? If not, the field coding becomes somewhat complex - especially since one has to avoid IF
fields if the fields are to survive a mailmerge.
--
Cheers
macropod
[Microsoft MVP - Word]
"S N" <s...@invalid.invalid> wrote in message news:OJfqFeck...@TK2MSFTNGP04.phx.gbl...
--
Hope this helps,
Doug Robbins - Word MVP
Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
"Doug Robbins - Word MVP" <d...@REMOVECAPSmvps.org> wrote in message
news:%23NIgzTe...@TK2MSFTNGP06.phx.gbl...
"macropod" <macr...@invalid.invalid> wrote in message
news:OTMWReek...@TK2MSFTNGP06.phx.gbl...
In that case, you need to place a field like:
{SET Sec1Pages {SECTIONPAGES}}
in each Section's footer, changing the '1' to match the Section numbers. Then, in the last Section's footer, a field like:
{={PAGE}-Sec1Pages-Sec2Pages-Sec3Pages \# "'Page {PAGE} of {={NUMPAGES}-1}';;"}
with as many '-Sec#Pages' expressions as needed (I'm assuming you've used a NUMPAGES field for the 'Y' part of the 'X of Y'
numbering). With this field code, the last page in each letter (always an even-numbered page with the previous field coding) won't
be included in the page numbering.
--
Cheers
macropod
[Microsoft MVP - Word]
"S N" <s...@invalid.invalid> wrote in message news:uchCzItk...@TK2MSFTNGP04.phx.gbl...