Selecting and Printing Text Across Multiple Bookmarks

G

George Shubin

Let's say I have a document with 6 bookmarks, bm1 through bm6. Between bm2
and bm4 are 2 section markers. I need to print from bm2 up to bm4. How do
I select across multiple bookmarks and print that range, which may include
multiple sections?

Thanks.
 
D

Dave Lett

Hi George,

You can use something like the following:

Dim oRng As Range
With ActiveDocument
Set oRng = .Range _
(Start:=.Bookmarks("bm2").Range.Start, _
End:=.Bookmarks("bm2").Range.Start)
oRng.Select
.PrintOut Range:=wdPrintSelection
End With

HTH,
Dave
 
R

Rahul Aggarwal

George,

You can iterate through the book marks in the document. When you find bm2,
mark its start position bm2.Start. Then look for bm4 and mark it start
position.
Once this is done you can assign Selection.Start = bm2.start and
Selection.end = bm4.

Rahul
 

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