ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   speak input box dialogue (https://www.excelbanter.com/excel-discussion-misc-queries/197206-speak-input-box-dialogue.html)

wizardmalcolm

speak input box dialogue
 
I have macros calling up input boxes to fill-in a form
It would be good to use "text to speech" to ask the question
Any ideas

Dave Peterson

speak input box dialogue
 
Option Explicit
Sub testme()

Dim resp As String
Dim myStr As String
myStr = "What's the code, Kenny?"

Application.Speech.Speak myStr
resp = InputBox(prompt:=myStr)

If resp = "" Then
'do nothing
Else
Application.Speech.Speak "You answered: " & resp
End If

End Sub

Personally, I would find this interesting/funny for the first couple of times.
Then I'd want it gone.

wizardmalcolm wrote:

I have macros calling up input boxes to fill-in a form
It would be good to use "text to speech" to ask the question
Any ideas


--

Dave Peterson

wizardmalcolm

speak input box dialogue
 
Works a treat thank you.
I agree about it getting boring, but its good to see how it can be done
Thanks again

"Dave Peterson" wrote:

Option Explicit
Sub testme()

Dim resp As String
Dim myStr As String
myStr = "What's the code, Kenny?"

Application.Speech.Speak myStr
resp = InputBox(prompt:=myStr)

If resp = "" Then
'do nothing
Else
Application.Speech.Speak "You answered: " & resp
End If

End Sub

Personally, I would find this interesting/funny for the first couple of times.
Then I'd want it gone.

wizardmalcolm wrote:

I have macros calling up input boxes to fill-in a form
It would be good to use "text to speech" to ask the question
Any ideas


--

Dave Peterson



All times are GMT +1. The time now is 04:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com