Macro help (printing and numbering documents)

I

Ithaca

Hello all,

I'm finally venturing into the world of macros and I'm stuck right now.
The situation: I have various controlled forms (sequentially numbered) here
at work that has a page in the document that I don't want printed. Currently,
I have to go in and manually change the form number before printing and this
gets annoying when I print up to 150 forms at a time.

Ideal solution: The ability to write a macro that will number the forms
sequentially (through a given range) and then print them indiviually with
only a selected page range actually printed (page 1-3, etc) and with specific
options selected for the printer (eg stapling).

The way that my printer works is that if I tell it to staple a document it
will staple the entire thing, even if it's multiple forms merged (via mail
merge). So far, i've used mail merge but haven't been too happy with the
results.

Does anyone have any ideas? Is this too much to ask of word?
 
D

Doug Robbins - Word MVP

The following code will send each "document" created by the mail merge to
the printer as a separate document, enabling you to get each one stapled
individually.

Or, see the article "Sequentially numbering multiple copies of single
document using a macro" at:

http://www.word.mvps.org/FAQs/MacrosVBA/NumberCopiesOf1Doc.htm


--
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
 
I

Ithaca

Thanks for the help but what code would I use for the mail merge? i don't
see any here. Also, I was able to find the Sequential numbering (two
versions) after a bit more reading of posts and links here. I've currently
got the one from word MVPs working and I'm going to try the one from
gregmaxey's site to see which one I like best. Now it's just a
functionality/ease of use issue.

The next addition to this macro will be to add in a "document linked to
printer macro" that I found at
http://www.kenyonck.addr.com/word/docprinter.htm Do you have any tips as far
as this goes or is it straight forward?
 
D

Doug Robbins - Word MVP

Sorry, I omitted to paste it into my reply. Here it is:

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


--
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
 
D

David Corliss

I had the same problem with the added twist that each document in a mail
merge had 2 sections. The macro below stapled the two sections as separate
documents. With a minor modification I successfully combined the two sections
into one document.
Dim i As Long
With ActiveDocument
For i = 1 To .Sections.Count
.PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" & i + 1
i = i + 1
Next i
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top