obtaining a Range object in header, using startpoint and endpoint

M

mjlaali

Hi,

I have the startPoint and the endPoint of a Range located in a header, but I
don't have the Range object itself. How can I obtain the Range object itself.
When I use the startPoint and the endPoint with
document.Range(startPoint, endPoint);
it gives me a Range located in the text of document and not the header.
 
M

macropod

Hi mjlaali,

You need to decide which Section and Header you want to work with. For example:
Dim Rng As Range
Set Rng = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
Rng.Start = StartPoint
Rng.End = EndPoint
 

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