MS Office Forum / General PowerPoint Questions / September 2007
On-screen keyboard on PP 2003/2007 presentation?
|
|
Thread rating:  |
Serge M. - 25 Aug 2007 19:24 GMT Hi,
Is there a way to bring on an on-screen keyboard when clicking on a link on the presentation, for users to type their info? And if there is, can I send this info to a particular folder on my computer?
Thank you,
Serge
PPTMagician - 26 Aug 2007 03:54 GMT Would this do? http://office.microsoft.com/en-us/powerpoint/ha010429541033.aspx
 Signature Thanks, Glenna Shaw Microsoft PowerPoint MVP Team http://www.pptmagic.com
> Hi, > [quoted text clipped - 5 lines] > > Serge Serge M. - 26 Aug 2007 06:50 GMT Thank you. But, how to get the on-screen keyboard, if users need to leave their info?
> Would this do? > http://office.microsoft.com/en-us/powerpoint/ha010429541033.aspx [quoted text clipped - 8 lines] > > > > Serge Steve Rindsberg - 26 Aug 2007 17:28 GMT > Thank you. > But, how to get the on-screen keyboard, if users need to leave their info? You could try something like this:
Add a textbox control Doubleclick it to open the VB editor Don't add anything to the Change event code it automatically creates for you. Instead paste this below the End Sub
Private Sub TextBox1_GotFocus() Shell "osk.exe" End Sub
Now go into slide show view and click in the textbox control
> > Would this do? > > http://office.microsoft.com/en-us/powerpoint/ha010429541033.aspx [quoted text clipped - 8 lines] > > > > > > Serge ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 26 Aug 2007 22:12 GMT 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?
Thank you, Serge
> > Thank you. > > But, how to get the on-screen keyboard, if users need to leave their info? [quoted text clipped - 30 lines] > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 26 Aug 2007 22:59 GMT > 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
> Thank you, > Serge [quoted text clipped - 33 lines] > > PPTools: www.pptools.com > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 26 Aug 2007 23:30 GMT I have the OSK on my computer, but you know, I'd prefer to create my own pseudo keyboard with shapes, because I couldn't find any good existing add-ins for the touch-screen application (maybe you could recommend some?).
I'm sorry, should I add this to my VBA project when I double-click on my text box?: 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
Ant also, how do I assign this macro to a shape I've created?
Thank you, Serge
> > 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 [quoted text clipped - 74 lines] > PPTools: www.pptools.com > ================================================ Serge M. - 27 Aug 2007 02:26 GMT Hi Steve, It works. I assigned this macro (below) to the rectangles with letters, and when I click on each rectangle in a slide-show view, the message box appears with only this letter.. then I have to click OK to close it, and do the same with the next rectangle, etc., i.e. a new message box appears for each letter when I click on rectangles, not together as a text.
How do I make letters appear together as a text in the text box?
Thanks, Serge
> 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. [quoted text clipped - 58 lines] > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 27 Aug 2007 16:11 GMT Hi Serge,
OK, next, use this instead of the first version of the subroutine:
Sub PseudoKeyboard(oSh As Shape) Dim strShapeText As String strShapeText = oSh.TextFrame.TextRange.Text ' MsgBox oSh.TextFrame.TextRange.Text With ActivePresentation.Slides(1).Shapes("TextBox1") .OLEFormat.Object.Text = .OLEFormat.Object.Text & strShapeText End With
End Sub
"TextBox1" is the default name PPT assigns to the first text box control on a slide. You may need to change the code above to match any changes you (or PPT) have made to the control's name.
> Hi Steve, > It works. I assigned this macro (below) to the rectangles with letters, and [quoted text clipped - 70 lines] > > PPTools: www.pptools.com > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 28 Aug 2007 03:46 GMT Hi Steve, I've just created a new macro (that you suggested below) and assigned it to the rectangular with a letter - and it doesn't work, i.e. it does not type this letter in the text box. I have only one text box on this slide, and it looks like it's still named TextBox1. What should I do?
Thanks, Serge
> Hi Serge, > [quoted text clipped - 96 lines] > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 28 Aug 2007 15:35 GMT Hi Serge,
Please copy the actual code from your project and paste it here ... thanks.
> Hi Steve, > I've just created a new macro (that you suggested below) and assigned it to [quoted text clipped - 105 lines] > > PPTools: www.pptools.com > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 28 Aug 2007 15:50 GMT Hi Steve, This is what I have now.. (and the letter appears in the message box when I click on the shape):
Private Sub TextBox1_Change()
End Sub
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
Is that what you asked for?
> Hi Serge, > [quoted text clipped - 115 lines] > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 28 Aug 2007 20:17 GMT Ah. You're still using the original test code I posted, w/o the changes I asked you to make.
This is what you should be using:
Sub PseudoKeyboard(oSh As Shape) Dim strShapeText As String strShapeText = oSh.TextFrame.TextRange.Text With ActivePresentation.Slides(1).Shapes("TextBox1") .OLEFormat.Object.Text = .OLEFormat.Object.Text & strShapeText End With End Sub
> Hi Steve, > This is what I have now.. (and the letter appears in the message box when I [quoted text clipped - 132 lines] > > PPTools: www.pptools.com > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 28 Aug 2007 22:50 GMT Actually, that's exactly what I did before, when you told me to substitute and it didn't work (so, I put back the message box code). I've just done again - it looks like this now:
Private Sub TextBox1_Change()
End Sub
Sub PseudoKeyboard(oSh As Shape) Dim strShapeText As String strShapeText = oSh.TextFrame.TextRange.Text With ActivePresentation.Slides(1).Shapes("TextBox1") .OLEFormat.Object.Text = .OLEFormat.Object.Text & strShapeText End With End Sub
...and it doesn't work - no text appears in the text box, for some reason...
Serge
> Ah. You're still using the original test code I posted, w/o the changes I asked you to make. > [quoted text clipped - 152 lines] > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 29 Aug 2007 02:28 GMT > Actually, that's exactly what I did before, when you told me to substitute > and it didn't work (so, I put back the message box code). I've just done > again - it looks like this now: Copied/pasted into a new presentation here, added the needed "key" shapes with text in them, added a text box control and it works fine.
Things to check:
- Macro security (set it to medium or low) - You've drawn a "key" to click, assigned it a Run Macro: PseudoKeyboard action setting and typed text into it
> Private Sub TextBox1_Change() > [quoted text clipped - 170 lines] > > PPTools: www.pptools.com > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 16 Sep 2007 23:40 GMT It works on a new slide of a brand new presentation. But when I do it on an xisting presentation - it doesn't. Why is that? Thank you
> > Actually, that's exactly what I did before, when you told me to substitute > > and it didn't work (so, I put back the message box code). I've just done [quoted text clipped - 190 lines] > PPTools: www.pptools.com > ================================================ Serge M. - 17 Sep 2007 00:08 GMT Steve, I found the reason - it works in another presentation but only when it's the first file.
But how do I make the SPACE and BACKSPACE keys function properly? And how do I make the SAVE button send the info typed in the textbox to a certain file on my computer?
Thank you. Serge
> > Actually, that's exactly what I did before, when you told me to substitute > > and it didn't work (so, I put back the message box code). I've just done [quoted text clipped - 190 lines] > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 17 Sep 2007 02:38 GMT > Steve, > I found the reason - it works in another presentation but only when it's the > first file. First slide, you mean? Yes. The *example* code I posted assumed that the text boxes are on the first slide.
With ActivePresentation.Slides(1).Shapes("TextBox1")
> But how do I make the SPACE and BACKSPACE keys function properly? Space should work ok if you put a space into the shape as its text. Modify your code to something like this to get Backspace to work (make the "key" shape text = Backspace"
Sub PseudoKeyboard(oSh As Shape)
Dim strShapeText As String strShapeText = oSh.TextFrame.TextRange.Text With ActivePresentation.Slides(1).Shapes("TextBox1") With .OLEFormat.Object Select Case .Text Case Is = "Backspace" ' delete the last character .Text = Left$(.Text, Len(.Text)-1) Case Else .Text = .Text & strShapeText End Select End With
End Sub
> And how do > I make the SAVE button send the info typed in the textbox to a certain file > on my computer? General-purpose routine for writing a string to a text file http://www.pptfaq.com/FAQ00514.htm
> Thank you. > Serge [quoted text clipped - 10 lines] > > - Macro security (set it to medium or low) > > - You've drawn a "key" to click, assigned it a Run Macro: PseudoKeyboard action setting and typed text into it
> > > > This is what you should be using: > > > > [quoted text clipped - 158 lines] > > PPTools: www.pptools.com > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 17 Sep 2007 04:22 GMT SPACE function workes. BACKSPACE - doesn't.
I typed BACKSPACE in the "key" shape and changes the code into your last suggestion:
Sub PseudoKeyboard(oSh As Shape)
Dim strShapeText As String strShapeText = oSh.TextFrame.TextRange.Text With ActivePresentation.Slides(1).Shapes("TextBox1") With .OLEFormat.Object Select Case .Text Case Is = "Backspace" ' delete the last character .Text = Left$(.Text, Len(.Text)-1) Case Else .Text = .Text & strShapeText End Select End With
End Sub
..and it jst types "BACKSPACE" in the textbox when I hit the key. What did I do wrong?
> > Steve, > > I found the reason - it works in another presentation but only when it's the [quoted text clipped - 218 lines] > PPTools: www.pptools.com > ================================================ Serge M. - 17 Sep 2007 09:26 GMT I read some of your seminars about VB on your website - pretty interesting.. I guess I'm getting a bigger picture, little by little.. 1. BACKSPACE key issue. I have created a new module with the last code you gave me, named it "Backspace" and assigned it to the BACKSPACE "key" shape. Now this "key" doesn't type this word in the textbox, nothing happents, and it doesn't delete the last character.
2. SAVE button issue. I read thru your "Geberal Purpose..." and did it all. When I press F5 - the notepad pops-up with the text I inserted in the code, and it sends it to the TEMP folder. 1) But it's all happening in VB, not on the presentation. 2) Now, how to give the button SAVE a command to send the text typed in the textbox right to that TEMP folder, without popping-up anywhere, and emptying the text box?
Sorry if it sounds confusing - I just started with VB and not that strong with your terminology. I really appreciate your help.
Thank you, Serge
> > Steve, > > I found the reason - it works in another presentation but only when it's the [quoted text clipped - 218 lines] > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 17 Sep 2007 15:08 GMT > I read some of your seminars about VB on your website - pretty interesting.. > I guess I'm getting a bigger picture, little by little.. Thanks ... it does take a while if you're starting from scratch.
> 1. BACKSPACE key issue. I have created a new module with the last code you > gave me, named it "Backspace" and assigned it to the BACKSPACE "key" shape. > Now this "key" doesn't type this word in the textbox, nothing happents, and > it doesn't delete the last character. Pesky aircode. Try this instead, and for extra credit, tell me why it works better than the original <G>.
Sub PseudoKeyboard(oSh As Shape)
Dim strShapeText As String strShapeText = oSh.TextFrame.TextRange.Text
With ActivePresentation.Slides(1).Shapes("TextBox1") With .OLEFormat.Object Select Case oSh.TextFrame.TextRange.Text Case Is = "Backspace" ' delete the last character .Text = Left$(.Text, Len(.Text) - 1) Case Else .Text = .Text & strShapeText End Select End With End With End Sub
> 2. SAVE button issue. I read thru your "Geberal Purpose..." and did it all. > When I press F5 - the notepad pops-up with the text I inserted in the code, > and it sends it to the TEMP folder. 1) But it's all happening in VB, not on > the presentation. 2) Now, how to give the button SAVE a command to send the > text typed in the textbox right to that TEMP folder, without popping-up > anywhere, and emptying the text box? Assign its click action as Run Macro: SaveMe
Sub SaveMe() ' ALL ON ONE LINE: Call WriteStringToFile("C:\Temp\BlahBlah.txt", ActivePresentation.Slides(1).Shapes("TextBox1").OLEFormat.Object.Text) ' Substitute the path/file.ext you want to use above End Sub
Sub WriteStringToFile(pFileName as String, pString as String) Dim intFileNum as Integer intFileNum = FreeFile Open pFilename For Output As intFileNum Print #intFileNum, pString Close intFileNum End Sub
> Sorry if it sounds confusing - I just started with VB and not that strong > with your terminology. I really appreciate your help. [quoted text clipped - 224 lines] > > PPTools: www.pptools.com > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 17 Sep 2007 23:16 GMT Hi Steve, It doesn't work. 1) Should this code be assigned to all "keys" or only to BACKSPACE "key"?:
Sub PseudoKeyboard(oSh As Shape)
Dim strShapeText As String strShapeText = oSh.TextFrame.TextRange.Text
With ActivePresentation.Slides(1).Shapes("TextBox1") With .OLEFormat.Object Select Case oSh.TextFrame.TextRange.Text Case Is = "Backspace" ' delete the last character .Text = Left$(.Text, Len(.Text) - 1) Case Else .Text = .Text & strShapeText End Select End With End With End Sub
I assign it to the BACKSPACE "key", and it still doesn't backspace.
2) I assigned my SAVE button's click action as Run Macro: SaveMe
Sub SaveMe() ' ALL ON ONE LINE: Call WriteStringToFile("C:\Temp\BlahBlah.txt", ActivePresentation.Slides(1).Shapes("TextBox1").OLEFormat.Object.Text) ' Substitute the path/file.ext you want to use above End Sub
Sub WriteStringToFile(pFileName as String, pString as String) Dim intFileNum as Integer intFileNum = FreeFile Open pFilename For Output As intFileNum Print #intFileNum, pString Close intFileNum End Sub ... and I changed the path to C:\Temp\Testfile.txt, and it doesn't save text in this file.
Your On-screen Keyboard sample works fine. I can just use it for the Backspace issue. But should I do with the SAVE issue?
Any suggestions?
Sorry for confusion, Serge
> > I read some of your seminars about VB on your website - pretty interesting.. > > I guess I'm getting a bigger picture, little by little.. [quoted text clipped - 247 lines] > > > > > > > > > > > > > > > PPTools: www.pptools.com > > > > > > > > > > > > > > > ================================================ Serge M. - 18 Sep 2007 07:06 GMT Hi again Steve,
I've handled the BACKSPACE issue, but still cannot resolve the SAVE button problem. Once I change the path/file.ext from your "C:\Temp\BlahBlah.txt" (below), to my "C:\Temp\Infofile.txt", a little textbox pops-up saying "Expected: expression". I tried to read Help on that, but I'm still far from understanding stuff like "..you may have forgotten to specify a value for a named argument.." and how to correct that.
Do you know how to correct it? I just want the SAVE button to send the contact info, users type in the textbox, to my "Infofile.txt" file, and once it's saved there, the textbox on presentation should become empty again for the next user. Is it possible?
Thank you for your patience, Serge
> Assign its click action as Run Macro: SaveMe > [quoted text clipped - 209 lines] > > > > > > > > > > > > > > > PPTools: www.pptools.com > > > > > > > > > > > > > > > ================================================ Steve Rindsberg - 18 Sep 2007 17:02 GMT > Hi again Steve, > [quoted text clipped - 10 lines] > it's saved there, the textbox on presentation should become empty again for > the next user. Is it possible? Sure, but let's start by posting the exact code you have to date.
> Thank you for your patience, > Serge [quoted text clipped - 212 lines] > > > > > > > > > > > > > > > > PPTools: www.pptools.com > > > > > > > > > > > > > > > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 18 Sep 2007 19:30 GMT > Sure, but let's start by posting the exact code you have to date. Hi, this is what I have to date:
Sub SaveMe() ' ALL ON ONE LINE: Call WriteStringToFile("C:\Temp\Infofile.txt", ActivePresentation.Slides(1).Shapes("TextBox1").OLEFormat.Object.Text) ' Substitute the path/file.ext you want to use above End Sub
Sub WriteStringToFile(pFileName As String, pString As String) Dim intFileNum As Integer intFileNum = FreeFile Open pFileName For Output As intFileNum Print #intFileNum, pString Close intFileNum End Sub
Thank you..
> > Thank you for your patience, > > Serge [quoted text clipped - 218 lines] > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 19 Sep 2007 02:42 GMT This works fine here.
Do you actually have a textbox control named "TextBox1" on Slide 1?
> > Sure, but let's start by posting the exact code you have to date. > [quoted text clipped - 240 lines] > > PPTools: www.pptools.com > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Steve Rindsberg - 17 Sep 2007 20:02 GMT Hi again, Serge
This on-screen keyobard seemed like the kind of thing that might be useful to more people so I've pulled some of the bits of code together in an example PPT file:
Add an On-Screen Keyboard to your presentation http://www.pptfaq.com/FAQ00895.htm
----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 27 Sep 2007 08:51 GMT > Hi again, Serge > This on-screen keyobard seemed like the kind of thing that might be useful to more people so I've pulled some of the bits of code together in an example PPT file: > > Add an On-Screen Keyboard to your presentation > http://www.pptfaq.com/FAQ00895.htm Hi Steve,
I also thought that maybe you could post a similar "on-screen keyboard" sample (as you suggest above) but with a shape "SAVE" (or "SUBMIT") and its assigned macro to make it send the info from the text-box to a specified file. That's the ultimate reason of having the on-screen keyboard - to collect info, so it would be also useful for more people.
Thank you,
Serge
> ----------------------------------------- > Steve Rindsberg, PPT MVP > PPT FAQ: www.pptfaq.com > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 27 Sep 2007 16:26 GMT > > Hi again, Serge > > This on-screen keyobard seemed like the kind of thing that might be useful to more people so I've pulled some of the bits of code together in an example PPT file: [quoted text clipped - 9 lines] > file. That's the ultimate reason of having the on-screen keyboard - to > collect info, so it would be also useful for more people. You can use this to write to a file:
General-purpose routine for writing a string to a text file http://www.pptfaq.com/FAQ00514.htm
Adding a button and setting a macro to call it should be simple enough
----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
Serge M. - 27 Sep 2007 20:41 GMT Hi Steve, I'm sorry for the headache - I finally (!) found the reason (a syntax error) that prevented that code to execute the command. The code works fine now. But how to empty the text-box for the next user, once the info is saved? E.g. if I try to collect attendies' contact info: how to make the info, that was typed and submitted by one user, dissappear from text-box once this info's been sent to my file, to let the next user type his/her info too?
Thanks again,
Serge
> > > Hi again, Serge > > > This on-screen keyobard seemed like the kind of thing that might be useful to more people so I've pulled some of the bits of code together in an example PPT file: [quoted text clipped - 22 lines] > PPTools: www.pptools.com > ================================================ Steve Rindsberg - 28 Sep 2007 07:40 GMT > Hi Steve, > I'm sorry for the headache - I finally (!) found the reason (a syntax error) [quoted text clipped - 3 lines] > was typed and submitted by one user, dissappear from text-box once this > info's been sent to my file, to let the next user type his/her info too? Off top of head: At the end of the routine that writes the text out to a file, set the text box's .TextFrame.TextRange.Text=""
> Thanks again, > [quoted text clipped - 26 lines] > > PPTools: www.pptools.com > > ================================================ ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================
|
|
|