Solved

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

Posted on 2010-09-15
2
283 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
This collection of functions covers all the normal rounding methods of just about any numeric value.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

726 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