Cursor at beginning of paragraph 
Author Message
 Cursor at beginning of paragraph

Hello,

How do I determine if the cursor is at beginning of paragraph?



Wed, 10 Mar 2004 17:20:01 GMT  
 Cursor at beginning of paragraph
Hi Robot,

Use

Dim arange As Range, selrange As Range
Set arange = Selection.Paragraphs(1).Range
arange.End = arange.Start
Set selrange = Selection.Range
If selrange.Start = arange.Start And selrange.End = arange.End Then
    MsgBox "The selection is at the start of the paragaph"
End If

Please post any response to the newsgroups for the benefit of others who may
also be following the thread.

Hope this helps,
Doug Robbins - Word MVP

Quote:
> Hello,

> How do I determine if the cursor is at beginning of paragraph?



Wed, 10 Mar 2004 19:03:30 GMT  
 Cursor at beginning of paragraph
Hi robot,

Doug's code can be compressed somewhat.

If Selection.Start = Selection.Paragraphs(1).Range.Start Then
    'cursor is at start of para
Else
    'it isn't
End If

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email


Quote:
> Hello,

> How do I determine if the cursor is at beginning of paragraph?



Thu, 11 Mar 2004 09:22:05 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to move to the beginning of a paragraph

2. Delete from beginning of line to paragraph mark

3. Blank space at beginning of paragraph when Text Interpretation is set to HTML Text

4. Set cursor location at the beginning of a text selection

5. Begin Transaction sets opened recordset in zombie state (alternative question: client and server side cursors)

6. cursor in first paragraph

7. Detecting cursor move between paragraphs

8. Moving cursor to specific paragraph

9. Delete range of paragraphs based on start text of paragraphs

10. select paragraph, prompt, select next paragraph

11. Linking a paragraph to another paragraph.

12. No Open Cursor or Cursor Closed

 

 
Powered by phpBB® Forum Software