The Text To Speech Way:
The text to speech way is when someone types in a text and when you click a button, it says it.
You need:
1 TextBox
1 Button (Rename the text to "Say!")
Code:
In Button1:
[vb]Dim SAPI ' Declares SAPI as a variable.
SAPI = CreateObject("SAPI.spvoice") ' SAPI is creating a object.
SAPI.speak(TextBox1.Text) ' It speaks whatever you type in TextBox1.[/vb]
------------------------------------------------------------------
The Form Load Way:
The form load way is when someone opens the program, it automatically says the words you put in the code.
You need:
A form
Code:
In Form1_Load:
[vb]Dim SAPI ' Declares SAPI as a variable.
SAPI = CreateObject("SAPI.spvoice") ' SAPI is creating a object.
SAPI.speak("Hello!") ' It speaks whatever you type between "".[/vb]