Referring to beginning of line

S

Steve Sanford

How do you refer to the beginning of a line as a range without selecting it?
I frequently want to perform tasks that involve questions like "How long is
it from Selection (or Range) to the beginning of the line?"

This is probably an elementary question with a simple answer, I hope. It
seems, though, that referring to lines of text only works with "Selection.
...." expressions which force you move the selection.

Thanks for any assistance.

SteveS
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Steve,

If you use

Dim myRange as Range
Set myRange = ActiveDocument.Bookmarks("\line").Range
myRange.End = myRange.Start

myRange will then refer to the start of the line in which the cursor is
located.

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