Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1209
  • Last Modified:

What is the VBA Character for a Shift-Return?

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.
0
TimLitle
Asked:
TimLitle
  • 2
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
the character to insert it chr(11):

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

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
ps: these kinds of things are very easy to be found out with the MS Office Macro recorder...
0
 
cquinnCommented:
You can also use vbVerticalTab
0
 
TimLitleAuthor Commented:
Thanks -- this was the information I was looking for!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now