Got a workaround for this Word XP bug?

D

Dennis Jones

Hi ... thanks for reading this ...

1. In Word XP, create a new document and enter in at least 10 paragraphs of
text.
2 Add a module with these procedures:

Public Sub Setup()
CustomizationContext = ActiveDocument
With KeyBindings
.ClearAll
.Add wdKeyCategoryMacro, "Testeroo", BuildKeyCode(wdKeyTab)
End With
End Sub

Sub Testeroo()
StatusBar = "Some Text"
ActiveDocument.Paragraphs(10).Range.Select
End Sub

3. Run the Setup sub.
4. In the document, press Tab. Paragraph 10 is selected.
5. Type a single letter ... nothing happens. If you continue to type, all
subsequent characters are entered normally.

NOTE: Surprisingly this bug does not appear for paragraphs 1 through 9! Only
from 10 onward!

I need to be able to take the user to a selected range of text and display a
status and not have the first character a user types be ignored. Thoughts?

Thanks in advance,

Dennis
 
D

Doug Robbins

In my testing of this, the same behavious occurs with all the paragraphs
less than 10 that I tried it with and what is happening is that the first
keystroke is being used by Word to wipe out the status bar text. Without
the StatusBar = "Some Text"

Maybe if you used a MsgBox to convey the information that you were providing
in the Status Bar, pressing Enter or clicking on the OK button in the
message box might be a bit more intuitive.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
D

Dennis Jones

Hi Doug,

Thanks for your response. That is interesting that you get the problem in
all paragraphs. Hmmm...

Anyway, my client would keel-haul me if I put up a message box -- although
it is very intuitive, it is also very intrusive. I'm hoping someone has a
better workaround.

Anyone?
 
D

DA

Hi Dennis

You could always try a SendKeys Left or similar.
Ugly workaround, but it may get you out of trouble.

Dennis
 
D

Dennis Jones

Good idea, Dennis #2.

Instead of sending {Left}, I will send an {Esc}. I think {Left} will
deselect my text (when the bug doesn't show itself) and I believe {Esc} will
basically do nothing.

Thanks,

Dennis #1
 

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