Header
PowerPoint tips, hints and tutorials that will change your presentations for ever!

INDEX

 

Jigsaws
Sounds
Video
Custom Shows
vba code
NaviSlides
Games for teachers
Bullets
Triggers
Security
Flash Cards
Multiple Instances
PowerPoint 2007
Mail Merge
Random events
Animation
Hyperlinks
Set spellcheck language


Home buttonTutorial buttonContact buttonProducts button


Speaking Message Boxes

If you have used code like this at the start of a presentation:

Sub welcome_user()
Dim strMsg As String
strMsg = InputBox("What is your name?")
MsgBox "Welcome " & strMsg
End Sub

Well image how much more surprizing it would be if the PC spoke to the user"

Well Vista and 7 come with a quite realistic voice "Anna" that you can tap in to with code like this:

Sub speak_to_me()
Dim strSpeak As String
Dim SAPIObj As Object
Set SAPIObj = CreateObject("SAPI.SPvoice")
SAPIObj.Rate = -2
strSpeak = InputBox("What is your name?")
If strSpeak <> "" Then
strSpeak = strSpeak & ", Welcome!"
Else
strSpeak = "Enter your name please!"
End If
SAPIObj.Speak "<pitch middle='-15'>" & strSpeak
End Sub

Rate can be adjusted -10 >> +10 and Pitch -25 >> + 25

Should still work in earlier OS's but the voice may be a bit clunky!

Speak the Text of a Shape on Click / Mouseover in Show Mode

Sub speak_to_me2(oshp As Shape)
'give shapes a click/ mouseover action of Run Macro
Dim strSpeak As String
Dim SAPIObj As Object
Set SAPIObj = CreateObject("SAPI.SPvoice")
SAPIObj.Rate = -2
SAPIObj.Speak "<pitch middle='-15'>" & oshp.TextFrame.TextRange
End Sub

 

 


 

Back to the Index Page

POWERPOINT BLOG

Articles on your favourite sport

Free Microsoft PowerPoint Advice, help and tutorials, Template Links
This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175
PowerPoint® is a registered trademark of the Microsoft Corporation