Hi Doug,
I downloaded PC User's sample last night and tried it in Access 2002. I
could not get it to work properly. I found something really strange. I could
get the btnReadToMe_Click() and btnSpeakToMe_Click() procedures to work, in
Access, only in break mode (ie. setting a break point and then executing each
line with the F8 key). When I removed the break point, I didn't hear anything:
Private Sub btnReadToMe_Click()
Dim Voice As SpVoice
Set Voice = New SpVoice
Voice.Speak Nz(Me.Text0, ""), SVSFlagsAsync
End Sub
Private Sub btnSpeakToMe_Click()
Dim Voice As SpVoice
Set Voice = New SpVoice
Voice.Speak "Hello. My name is Peter.", SVSFlagsAsync
End Sub
I converted the sample to Access 97. The same thing is happening....no voice
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6675
heard unless I run the code in break mode. In addition, I received an
ambiguous name detected error in Access 97 when I attempted to compile the
code. This occurred on the line of code that reads:
Dim WithEvents RecoContext As SpSharedRecoContext
which was found in two Private Subs. I commented out these two declarations
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6675
and moved this line of code to the top of the module, to declare this at the
module level. When I attempt to compile in Access 97, I'm now receiving
"Automation type not supported in Visual Basic" error on the following:
' the following is the event handler for the recognition event
Private Sub RecoContext_Recognition(ByVal StreamNumber As Long, _
ByVal StreamPosition As Variant, _
ByVal RecognitionType As SpeechRecognitionType, _
ByVal Result As ISpeechRecoResult _
)
In short, I'm not having much luck getting this to work in either Access 97
or 2002. I thought last night that perhaps this code only works in VB, not
VBA, but your mention that you can get it to work in Access 97 seems to
indicate that something else is the problem.
Is there any chance that you would be willing to post your working sample in
Access 97 to your web site?
Thanks,
Tom
______________________________________________
"Douglas J Steele" wrote:
I'm not about to download and open the attachment, but the code outlined in
the eggheadcafe article worked fine for me in Access 97, so I'd assume it'll
work in newer versions as well.
What problem are you having?
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)