I'm trying to do that, and as soon I click on the text control in a view
mode, the window pops-up saying: "Run-time error '5'. Invalid procedure call
or argument" with options to End or Debug.
What should I do?
Check to seee that you actually have OSK.EXE on your PC: choose Start, Run; type
OSK.EXE into the text box then click OK. Does that bring up an on-screen keyboard?
If not, do a file search for OSK.EXE ... if it's somewhere on your PC other than on
the path, you'll have to modify the VBA code to include the entire path to OSK.EXE
If it's not on your PC, you won't be able to run it, of course.
You could possibly create your own via a user form with buttons or other controls for
each letter you want to allow users to enter.
In theory you could even do it with shapes in PPT itself.
Add this to your VBA project:
Sub PseudoKeyboard(oSh As Shape)
' you'd actually use this to add the text to your
' text control, but for proof of concept, we'll
' just msgbox the text:
MsgBox oSh.TextFrame.TextRange.Text
End Sub
Assign this macro to a rectangle you've drawn on the slide.
Now select the rectangle and type A
Copy it, change the text to B
Copy it, change the text to C
... etc
Now try clicking each shape in slide show view