Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
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.
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now