How to read character-at-a-time in a Microsoft Word macro?

S

skihardlivehigh

I would like to write a Microsoft Office macro (primarily for use in MS
Word) to read from the keyboard a character at a time, such that I can
act on each character as it is read.

To avoid clutter, I specifically do not want to use a dialog box (if I
can avoid it).

I apologize if I am overlooking the obvious, perhaps you can give me a
clue...

Background : Why do I want this?
==========
(BTW, If you know the following feature/product exists someplace, I'd
be delighted to hear about it... I don't need to reinvent the wheel.)

I use "incremental search" constantly. It saves a great deal of typing
& time. I can't find anything in Microsoft Word that does this, so I
figured a little VBA, a few bookmarks and highlights, and voila!
Except: I don't see how to read keyboard input one character at a time.

Incremental Search is:
=====================
For example, let's say you want to find "incremental". Currently, in
Word, you type:
Ctrl-Fincremental<enter>
A fair bit of typing (13 keystrokes -- even more time if you use the
mouse).

If IncrementalSearch were bound to Ctrl-S, I could type:
Ctrl-Si (selection moves to next "i") n (selection moves to next "in")
c (selection moves to next "inc").
Possibly, at this point, I am done. I can see right on the screen that
I have found the next instance of "inc" which happens to be the next
instance of "incremental". 4 keystrokes instead of 13, and no dialog
box covering interesting parts of the screen.

Many environmeents already support this feature (editors, Firefox, even
MS Visual C++ IDE). Why not Word?

Thoughts?

Thanks.
Kindest regards,
Matthew Miner

P.S. Apologies if dup posting - Couldn't find my first posting from two
days ago...
 

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