Select area to print.

J

John

Hi,
I have a long document and I would like to put the
marker as qqq at the beginning and qqq at the end of the
texts. when I print it only print from the beginning of
the marker qqq to the end of the qqq's are. How do I write
the code for it?

Any help would be very appreciated.
 
D

Doug Robbins - Word MVP

Hi John,

Use

Dim myrange As Range, i As Long
Set myrange = ActiveDocument.Range
i = InStr(myrange, "qqq") + 2
myrange.Start = myrange.Start + i
i = InStr(myrange, "qqq") - 1
myrange.End = myrange.Start + i
myrange.Select
ActiveDocument.PrintOut Range:=wdPrintSelection

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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