Created
August 17, 2015 23:24
-
-
Save yunga/66d2cff12e32c2d2cbf0 to your computer and use it in GitHub Desktop.
Use the speech api to say the clipboard content or the text entered in the input box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Use the speech api to say the clipboard content or the text entered in the input box | |
Dim Message, Clip, SAPI | |
' Get Clipboard Text | |
Set objHTML = CreateObject("htmlfile") | |
Clip = objHTML.ParentWindow.ClipboardData.GetData("text") | |
If Clip = "" or IsEmpty(Clip) or IsNull(Clip) Then | |
Clip = "Hello World!" | |
End If | |
' User Input | |
Message = InputBox("Enter your text:", "Say it!", Clip) | |
' Speak | |
Set SAPI = CreateObject("sapi.spvoice") | |
SAPI.Speak Message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment