What is the VBA Character for a Shift-Return?

Posted on 2007-10-07
Last Modified: 2008-01-09
I have an Word Document that has borders around some paragraphs.  Sometimes, I wish to enclose multiple paragraphs within the same border.  I can easily do this manually by keying in a Shift-Return instead of a Return in all but the last paragraph.  The result is exactly what I want -- ie, a single a border that encloses what looks like several different paragraphs.

How do I use VBA to include the Shift-Return?  vbCr, vbLf and vbCrLf all create a paragraph which is not what I want.  I suppose I could have VBA put in some character combination that would subsequently changed by a VBA controlled Find and Replace to the "Special" "Manual Line Break" character but there's got to be a better (and easier) way.
Question by:TimLitle
    LVL 142

    Accepted Solution

    the character to insert it chr(11):

    in vba:
    Selection.TypeText Text:=Chr(11)

    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    ps: these kinds of things are very easy to be found out with the MS Office Macro recorder...
    LVL 15

    Assisted Solution

    You can also use vbVerticalTab

    Author Comment

    Thanks -- this was the information I was looking for!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
    This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
    This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
    Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

    737 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

    16 Experts available now in Live!

    Get 1:1 Help Now