wait for keystroke after starting macro?

A

Abe Hendin

I'm looking for the simplest way to accomplish the "double character"
keyboard shortcuts available in some old DOS text editors and I think
Word 5 for DOS.

For example, to delete the next sentence, my client is apparently used
to CTRL-ds. I'm assuming this is similar to the CTRL-ks, namely CTRL-k
followed immediately by "s", style of shortcut that I use in my favorite
DOS text editor to save.

Is there a way to enable this functionality in Word XP/2003 without
using a macro? And if a macro is required, what's the most unobtrusive
means of collecting just the next character pressed after the macro is
started?

I'd rather not have him hit CTRL-d and get a userform prompting for the
next character. Instead, I'd want the macro to be activated by the first
key combo, then sit silently waiting for the next keystroke that I'd
then catch and pass to an appropriate subroutine. How can I catch this
without using an input box or other userform?

An example would be helpful. Thanks for input,

Abe
 
J

Jay Freedman

Hi, Abe,

Open the Tools > Customize dialog and click the Keyboard button at the
bottom. In that dialog you can define keyboard shortcuts, and they can
be double-character (the old WordStar convention) if that's what you
want. Just type the shortcut you want and click the Assign button.

Of course, if you use Ctrl+D or Ctrl+K as the "prefix" keystroke,
you'll lose the current assignments of those keys -- by default,
Ctrl+D opens the Font dialog, and Ctrl+K opens the Insert Hyperlink
dialog. Almost all the Ctrl+key combinations have default assignments.

For example you mention, delete next sentence, you would have to write
or record a macro and assign the shortcut to that, because Word
doesn't offer that function as a single command.
 
J

Jean-Guy Marcil

Jay Freedman said:
Hi, Abe,

Open the Tools > Customize dialog and click the Keyboard button at the
bottom. In that dialog you can define keyboard shortcuts, and they can
be double-character (the old WordStar convention) if that's what you

I thought I was the only one who ever used WordStar!
What a joy! It was so simple back then! Insert 5" floppy, start program...
Remove 5" floppy, insert 5" floppy for checking spelling, remove 5" floppy,
insert 5" floppy to save file... Ha... what fun it was! (Not to mention
using the numerical keyboard to draw tables!
?????
? ? ?
?????
? ? ?
?????

Then they invented the computer with two floppy drives! :-( ... Then they
really killed my fun by introducing hard disks!


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
A

Abe Hendin

Jay said:
keyboard shortcuts, and they can
be double-character (the old WordStar convention) if that's what you
want.

Cool! I didn't realize that a double key combo would work, though I've
assigned many a shortcut. Thanks for the info.

Nice to "see" you again, Jay--I'm still very grateful for your help with
that note conversion macro many moons back.
For example you mention, delete next sentence, you would have to write
or record a macro and assign the shortcut to that, because Word
doesn't offer that function as a single command.

Precisely what I've done, and for deleting a phrase. Word does include
SentLeft and SentRight; comparable commands for phrases might be nice,
but are easily written with the aid of Selection.Extend. VBA is awesome.

Abe
 

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