control print

C

Curt

Have the following macro do not understand when print screen shows check
pages 1-2 will not stop prints complete list. This was my object in having
print control. to get certain pages. Pages are taken from an excel sheet.
each row from excel is on its own page. Can anyone tell me where I went
wrong. Other times i've done this I have printer control This is first try
directly from an excel sheet Also if I ask for a certain page say 15 no print
Thanks
End With
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Name_of_Entry"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"CityState"
Selection.TypeParagraph
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Description"
Selection.TypeParagraph
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM `Announcer$` WHERE ((`Nbr` IS NOT NULL ) AND (`Name
of Entry` IS NOT NULL ) AND (`City&State` IS NOT NULL ) AND (`Description` IS
NOT NULL ))" _
& ""
With ActiveDocument.MailMerge
.Destination = wdSendToPrinter
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
Application.Quit SaveChanges:=wdDoNotSaveChanges
End With
ActiveWindow.Close
CommandBars("Stop Recording").Visible = False
End Sub
 
D

Doug Robbins - Word MVP

See the article "How to do a mail merge to the printer using VBA, without
displaying the Print dialog" at:

http://www.word.mvps.org/FAQs/MailMerge/MergeStraightToPrintrWVBA.htm

Then modify the ActiveDocument.PrintOut Background command so that it prints
out just the required pages (which actually will be Sections) to

ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="S1", To:="S2"

to print just the first and second pages.
--
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
 
C

Curt

am fimilar with the link for mail merge to printer. Trying to have others be
able to use printer screen that comes up to pick whatever pages they want.
Is this possible as the print screen doesn't seem to react as you tell it to
by checking options. Each row on excel sheet should be a page. No matter what
you pick it wants to print the whole sheet. It may be this is only it can be
done with printer screen as supplied.
Thanks
 

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

Similar Threads

Mail merge macro duplication 2
macro 2 issues 0
4198 debug 0
double merge 2
Macro fine in Word 2000... breaks in Word 2002...? 4
merge search to long 2
word data from excel 0
macro stops 0

Top