View Single Post
  #13   Report Post  
Posted to microsoft.public.word.docmanagement
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default Selecting sentence/paragraph with keyboard

I dont 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


"Don Ellis" wrote:


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

"Lene Fredborg" wrote:

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/Custom...roToHotkey.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