Solved

Word VBA: How do I check to see if my selection is a carriage return?

Posted on 2010-09-15
2
282 Views
Last Modified: 2012-05-10
Trying to write code to see if my selection is a carriage return or not.  
Anyone have some suggestions?
0
Comment
Question by:Raphelle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Expert Comment

by:ragnarok89
ID: 33686310
Can you be a little more specific? What do you mean by selection?
0
 
LVL 8

Accepted Solution

by:
PandaPants earned 500 total points
ID: 33686976
Try something like this:

Dim boolSelectionIsCarriageReturn As Boolean
    If Selection.Text = vbCr Then
        boolSelectionIsCarriageReturn = True
    Else
        boolSelectionIsCarriageReturn = False
    End If

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question