Speech Object Example

The following routine reads off the expense totals for all items that are greater than a limit set in another cell on the sheet:

Sub ReadHighExpenses()

Dim lTotal As Long Dim lLimit As Long Dim rng As Range

'Grab the limitation amount lLimit = wksAllowEditRange.Range("Limit")

'Loop through the expense totals

For Each rng In wksAllowEditRange.Range("Expenses") 'Store the current expense total lTotal = rng.Offset(0, 5).Value

'If the current total is greater than ' the limit, read it off If lTotal > lLimit Then

Application.Speech.Speak rng.Text Application.Speech.Speak lTotal End If Next rng

0 0

Post a comment