Wait ( Now + TimeValue ( "00:00:01" )) Application. Speak "Excel is talking to me", SpeakAsync : = True Application. Let’s go through a few examples to see how the arguments change the behavior of the speech method:įirst, we’ll add a MsgBox at the end of our original example macro: In other words, it “purges” the queued up text in favor of your new text. Purge - If you set this to True, your macro will stop saying anything it was in the process of saying and start saying your new string, instead.The default is False, since most of the time you’re not feeding the script any XML. SpeakXML - Setting this to True will cause your string to be interpreted as XML and any XML tags you have will not be spoken.In other words, by default your macro will pause until the voice finishes speaking. This is usually a good idea because it speeds up your code execution. SpeakAsync - By setting this to True, the VBA compiler will continue to march through your code while the voice is speaking.The other 3 arguments are optional and are described below: The first one, we know, is the string you want your computer to say. By default, it waits until the voice finishes talking before it continues with your macro, but you can change that!įortunately, accepts many arguments. The function gets Microsoft Excel to play whatever string you pass it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |