Selecting sentence/paragraph with keyboard

G

Guest

I try to avoid the mouse as much as possible. Is there a way to select a
sentence or paragraph using just the keyboard?

And how can I create a single keystroke that inserts these three keystrokes
-- [space][en dash][space]?

Thank you.

Don
 
L

Luc

Don,
For the selection part, you could use F8, press three times for a sentence
four times for a paragraph.
For the second part, maybe use an AutoCorrect item. Type [space][en
dash][space select it, go to Tools- AutoCorrectoptions, type a unique
character in the replace box, paste your selection in the replace with box.
 
G

Guest

An additional comment:
It may take a little time getting used to F8 because it brings you into
extended selection mode. You need to press ESC to return to normal selection
mode (the current selection remains even if you press ESC). Note that you can
use Shift+F8 to reduce the selection, e.g. from paragraph to sentence to word.

Alternatively, you could use these macros and assign keyboard shortcuts to
them:

Public Sub SelectCurrentSentence()
'Selects the current sentence
Selection.Expand Unit:=wdSentence
End Sub

Public Sub SelectCurrentParagraph()
'selects current paragraph
Selection.Expand Unit:=wdParagraph
End Sub

If you need help on assigning shortcuts, see:
http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToHotkey.htm

If you need help on installing macros, see;
http://www.gmayor.com/installing_macro.htm

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


Luc said:
Don,
For the selection part, you could use F8, press three times for a sentence
four times for a paragraph.
For the second part, maybe use an AutoCorrect item. Type [space][en
dash][space select it, go to Tools- AutoCorrectoptions, type a unique
character in the replace box, paste your selection in the replace with box.

--
Luc Sanders
(MVP - PowerPoint)
Don Ellis said:
I try to avoid the mouse as much as possible. Is there a way to select a
sentence or paragraph using just the keyboard?

And how can I create a single keystroke that inserts these three
keystrokes
-- [space][en dash][space]?

Thank you.

Don
 
S

Suzanne S. Barnhill

If you have the appropriate AutoFormat As You Type settings enabled, then
typing [space][hyphen][space] will result in [space][en dash][space]. I'l
grant you this is three keystrokes, but it doesn't require use of the mouse,
and I don't see how the mouse comes into this equation at all, anyway; if
the problem if just the en dash, you can assign a keyboard shortcut to that.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

....and most likely, you already have a shortcut assigned to en dash:
Ctrl+Num -
(i.e. minus on the numeric keypad).

However, if you use e.g. a laptop without a numeric keypad, that shortcut
cannot be used.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


Suzanne S. Barnhill said:
If you have the appropriate AutoFormat As You Type settings enabled, then
typing [space][hyphen][space] will result in [space][en dash][space]. I'l
grant you this is three keystrokes, but it doesn't require use of the mouse,
and I don't see how the mouse comes into this equation at all, anyway; if
the problem if just the en dash, you can assign a keyboard shortcut to that.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Don Ellis said:
I try to avoid the mouse as much as possible. Is there a way to select a
sentence or paragraph using just the keyboard?

And how can I create a single keystroke that inserts these three keystrokes
-- [space][en dash][space]?

Thank you.

Don
 
G

Guest

Hi Luc,

Thanks for pointing out the F8 selection technique, even though it's an
incredible nuisance (pressing 3 or 4 times and then needing Esc to get out of
that selection mode? Amazing...).

I've used WordPerfect for 20 years and one thing I like about it is the
convenience of setting what I consider basic keystrokes. Go to their keyboard
mapping and you find "Select Sentence" and "Select Paragraph" -- you then
just assign it to a key combination. It's something I wish Word would copy.

As for the [space][en dash][space], I might as well keep doing it the way
I'm doing it. There aren't any unique keystrokes I can think of that are less
trouble than Spacebar, Alt-/ for the en dash, and Spacebar.

I appreciate the input. Thanks again.

Don
 
G

Guest

Lene,

Thank you, for the the Esc warning and for the macros.

Making macros in Word is hardly intuitive. I was able to create
SelectCurrentSentence and assign it to Alt-S so I'm very pleased. That was
the one I was missing the most.

But when it came to creating SelectCurrentParagraph, I seem to only be able
to overwrite SelectCurrentSentence no matter what I do. I followed along the
linked instructions, but it seems I can only create a single macro. Oh, well,
I'm happy with that one.

Thanks very much... that one is great even if I never get another.

Don
 
G

Guest

Hi Suzanne,

I do have AutoFormat As You Type set but I think you'll find that you need
to type [space][hyphen][hyphen][space] to get my en dash with bookend spaces,
rather than [space][hyphen][space] as you suggest.

I don't want to harp on WordPerfect too much but their keyboard mapping
allows you to assign keystrokes to a particular key combination, so you can
simply assign [space][en dash][space] to Ctrl-/, for example. Quick and easy
and no need for macros and multiple keystrokes.

With every new release of Word, I keep hoping they will pick up some tips
from other developers.

Speaking of which, why can't I create my own custom keyboard in Powerpoint
and Excel, so that Ctrl-Shft-S equals Save As in all of them. Perhaps because
Microsoft is too busy adding more exotica and not reviewing the basics.

By the way, the mouse doesn't come into my second question -- it was an
afterthought.

Cheers,

Don
 
G

Guest

After Lene got me thinking about Macros (and I figured out how to display the
Developer's Ribbon in Word 2007), I simply recorded a macro for [space][en
dash][space] and assigned it to Ctrl-/.

Happy now... (or I would be if I could create a SelectCurrentParagraph macro
in addition to my SelectCurrentSentence).

Thanks to all of you for your help.

Don
 
S

Suzanne S. Barnhill

I am not in the habit of posting untested solutions. On my system,
[space][hyphen][space] does become [space][en dash][space] as advertised,
though not till after you finish typing the following word (that is, type
some text followed by a space or punctuation.

Although I don't think you can assign this particular combination to a
keystroke, you can accomplish many things with AutoCorrect (see
http://word.mvps.org/faqs/customization/AutoCorrect.htm), and you can save
any amount of text as an AutoText entry, and AutoText entries can be
assigned keyboard shortcuts.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Don Ellis said:
Hi Suzanne,

I do have AutoFormat As You Type set but I think you'll find that you need
to type [space][hyphen][hyphen][space] to get my en dash with bookend spaces,
rather than [space][hyphen][space] as you suggest.

I don't want to harp on WordPerfect too much but their keyboard mapping
allows you to assign keystrokes to a particular key combination, so you can
simply assign [space][en dash][space] to Ctrl-/, for example. Quick and easy
and no need for macros and multiple keystrokes.

With every new release of Word, I keep hoping they will pick up some tips
from other developers.

Speaking of which, why can't I create my own custom keyboard in Powerpoint
and Excel, so that Ctrl-Shft-S equals Save As in all of them. Perhaps because
Microsoft is too busy adding more exotica and not reviewing the basics.

By the way, the mouse doesn't come into my second question -- it was an
afterthought.

Cheers,

Don

Suzanne S. Barnhill said:
If you have the appropriate AutoFormat As You Type settings enabled, then
typing [space][hyphen][space] will result in [space][en dash][space]. I'l
grant you this is three keystrokes, but it doesn't require use of the mouse,
and I don't see how the mouse comes into this equation at all, anyway; if
the problem if just the en dash, you can assign a keyboard shortcut to that.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
 
G

Guest

Hi Suzanne,

My apologies... you are quite correct. I must not have begun typing the
following word before deciding it didn't work. And seeing the two hyphens
create an en dash, that just decided it for me.

I don't often visit here but when I do I see your name and your help
everywhere. Thank you very much for all that you do.

I ended up recording a macro for the keystrokes that works perfectly.

Thanks again.

Don


Suzanne S. Barnhill said:
I am not in the habit of posting untested solutions. On my system,
[space][hyphen][space] does become [space][en dash][space] as advertised,
though not till after you finish typing the following word (that is, type
some text followed by a space or punctuation.

Although I don't think you can assign this particular combination to a
keystroke, you can accomplish many things with AutoCorrect (see
http://word.mvps.org/faqs/customization/AutoCorrect.htm), and you can save
any amount of text as an AutoText entry, and AutoText entries can be
assigned keyboard shortcuts.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Don Ellis said:
Hi Suzanne,

I do have AutoFormat As You Type set but I think you'll find that you need
to type [space][hyphen][hyphen][space] to get my en dash with bookend spaces,
rather than [space][hyphen][space] as you suggest.
 
S

Suzanne S. Barnhill

It was a little confusing to me at first that two hyphens surrounded by
spaces produce a spaced en dash, whereas two hyphens without spaces produce
an em dash without spaces, but, conveniently, these two results represent
the usage in the U.S. (em dash) and U.K. (spaced en dash), so it works out
nicely.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Don Ellis said:
Hi Suzanne,

My apologies... you are quite correct. I must not have begun typing the
following word before deciding it didn't work. And seeing the two hyphens
create an en dash, that just decided it for me.

I don't often visit here but when I do I see your name and your help
everywhere. Thank you very much for all that you do.

I ended up recording a macro for the keystrokes that works perfectly.

Thanks again.

Don


Suzanne S. Barnhill said:
I am not in the habit of posting untested solutions. On my system,
[space][hyphen][space] does become [space][en dash][space] as advertised,
though not till after you finish typing the following word (that is, type
some text followed by a space or punctuation.

Although I don't think you can assign this particular combination to a
keystroke, you can accomplish many things with AutoCorrect (see
http://word.mvps.org/faqs/customization/AutoCorrect.htm), and you can save
any amount of text as an AutoText entry, and AutoText entries can be
assigned keyboard shortcuts.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Don Ellis said:
Hi Suzanne,

I do have AutoFormat As You Type set but I think you'll find that you need
to type [space][hyphen][hyphen][space] to get my en dash with bookend spaces,
rather than [space][hyphen][space] as you suggest.
 
G

Guest

I don’t know exactly what you did to copy the macros and what went wrong. Try
this in order to copy the SelectCurrentParagraph macro:

In Word, press Alt+F11. This will bring you to the Visual Basic Editor (VBE)
that opens in a separate window.

I suppose you saved the first macro in your Normal.dot. Therefore, in the
left side of the VBE window, double-click Normal. Now you will see two
folders, “Microsoft Word Objects†and “Modulesâ€. Double-click “Modulesâ€. Now
you will see the modules (containers for macros) found in your Normal.dot. If
you did not have any macros before yesterday, I think you will find only one
module named “NewMacros†- double-click that module. Now you should see the
“SelectCurrentSentence†macro plus the one you recorded (if you have more
modules, you can double-click them one by one to find your macros).

Copy the SelectCurrentParagraph macro from the newsgroup and paste it below
the other macros. In order to make sure that everything is correct, select
Debug (menu) > Compile Normal - if any errors are found in the macros in
Normal.dot, an error message will appear - hopefully, everything is correct.
In order to save Normal.dot, you can press Ctrl+S in the VBE while Normal.dot
is still selected (you can always see in the title bar of the VBE window
which document/template and module you are working on.).

When finished, close the VBE window. You can now assign a shortcut to the
SelectCurrentParagraph macro.

Hope this helps - once you get familiar with macros, it is actually helpful
to look at (and edit or maybe write) macros from the VBE. You could also have
a look at the code Word made for your en dash macro.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
G

Guest

Hi Suzanne,

This, as you note, is most confusing. Especially since I never paid enough
attention to what creates an em dash (because I've assigned the symbol to
Ctrl-/).

Because it takes two hyphens create an en dash, I just figured it took three
hyphens to create an em dash (not unthinkable considering it takes four stabs
of the F8 key to select a paragraph).

Looking at all of this again, I see that to create my [space][en
dash][space], you can use either of these:

[space][hyphen][space]
[space][hyphen][hyphen][space]

And to create an em dash with no spaces, you use two hyphens.

Which means that if you want an en dash with no hyphens, you either have to
use the keyboard shortcut, Alt + numeric keys, or insert the symbol using the
mouse.

Given that, I must stay that my mistaken idea of three hyphens for an em
dash seems the height of simplicity and logic.

Thanks again for your time and insights.

Don
 
J

Jay Freedman

After Lene got me thinking about Macros (and I figured out how to display the
Developer's Ribbon in Word 2007), I simply recorded a macro for [space][en
dash][space] and assigned it to Ctrl-/.

Happy now... (or I would be if I could create a SelectCurrentParagraph macro
in addition to my SelectCurrentSentence).

Thanks to all of you for your help.

Don

You can have such a macro, like this:

Sub SelectCurrentParagraph()
Selection.Paragraphs(1).Range.Select
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
G

Guest

Jay,

A macro like yours was included in my first post too, but for some reason,
Don did not succeed in installing it. A few hours ago, I tried to explain
what Don could do (in a new post), but I think it drowned in this long row of
posts - I will put a note to Don at the (current) end of the of this thread.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


Jay Freedman said:
After Lene got me thinking about Macros (and I figured out how to display the
Developer's Ribbon in Word 2007), I simply recorded a macro for [space][en
dash][space] and assigned it to Ctrl-/.

Happy now... (or I would be if I could create a SelectCurrentParagraph macro
in addition to my SelectCurrentSentence).

Thanks to all of you for your help.

Don

You can have such a macro, like this:

Sub SelectCurrentParagraph()
Selection.Paragraphs(1).Range.Select
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
G

Guest

Don,

Somewhere in the middle of this long thread you will find a post from me (a
few hours old) where I tried to explain how you can install the
select-sentence macro. Hope that will help you...

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
G

Guest

Hi Lene,

Thanks very much... I would have missed it without your note. Thanks very
much. I'm off to bed in Hong Kong right now but I'll certainly check it out
tomorrow.

(I just found it and scanned it quickly... thank you very much for your
time, trouble and advice. I will report to class in the morning.)

Cheers,

Don
 
S

Suzanne S. Barnhill

Interestingly, when I used to prepare manuscripts for publishers, -- for en
and --- for em was the convention. I suspect they just used a global replace
to convert the documents. I also have assigned a keyboard shortcut to the en
dash because, as you say, there is no simple way to insert one without
spaces, and where I use them most is in number ranges and the like (and I
don't have access to the numeric keypad and would find it awkward even if I
did).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Don Ellis said:
Hi Suzanne,

This, as you note, is most confusing. Especially since I never paid enough
attention to what creates an em dash (because I've assigned the symbol to
Ctrl-/).

Because it takes two hyphens create an en dash, I just figured it took three
hyphens to create an em dash (not unthinkable considering it takes four stabs
of the F8 key to select a paragraph).

Looking at all of this again, I see that to create my [space][en
dash][space], you can use either of these:

[space][hyphen][space]
[space][hyphen][hyphen][space]

And to create an em dash with no spaces, you use two hyphens.

Which means that if you want an en dash with no hyphens, you either have to
use the keyboard shortcut, Alt + numeric keys, or insert the symbol using the
mouse.

Given that, I must stay that my mistaken idea of three hyphens for an em
dash seems the height of simplicity and logic.

Thanks again for your time and insights.

Don


Suzanne S. Barnhill said:
It was a little confusing to me at first that two hyphens surrounded by
spaces produce a spaced en dash, whereas two hyphens without spaces produce
an em dash without spaces, but, conveniently, these two results represent
the usage in the U.S. (em dash) and U.K. (spaced en dash), so it works out
nicely.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
 
G

Guest

Hi Lene,
I don’t know exactly what you did to copy the macros and what went
wrong.

As a teacher, you can never know what mischief your students will get up to
-- or what misconceptions are lurking in their untutored minds.

My years of WordPerfect experience make me view macros as individual
entities. What I didn’t expect was to put two or more macros in a single file
before saving. So I was creating my Sentence macro and saving. And then
creating a Paragraph macro which automatically overwrote it.

It was this sentence in your instructions that turned on the light...
Copy the SelectCurrentParagraph macro from the newsgroup and paste it
below the other macros.

So I did. And now they both work.

Thanks again for taking the time to explain all this. You may not get paid,
but you have my undying appreciation... and that’s no joke. Two things kept
me from switching totally from WordPerfect to Word: 1) the Sentence/Paragraph
keystrokes, and 2) Word’s awful handling of tables in versions before 2007.

So I spent my days writing in WordPerfect, converting to Word, then bringing
the document into Word for fine-tuning before sending it off to other Word
users. That’s how much I liked WP.

With your help getting over this initial speed bump, I may just focus on
learning the quirks of Word now. (A task that would be simpler with a manual,
so I suppose I should buy one, especially considering my disdain for online
help files.)

Again, thank you. You’ve made a huge difference.

Cheers,

Don

Thanks also to Jay, whose message I also missed.

I think the problem is the time lag between someone's posting and the
website's displaying. Once you scroll past an area with no new messages, you
tend not to visit that area again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top