CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Object: SpObjectToken

GetAttribute Method

The GetAttribute method returns the value of the specified attribute.

The String returned contains the value for the Attribute. If the Attribute is present but does not contain additional information, the String will be Empty. If the Attribute is not present, SPERR_NOT_FOUND is returned. Not all engines support all attributes and it is possible to customize attributes for each engine.


SpObjectToken.GetAttribute(
     AttributeName As String
) As String

Parameters

AttributeName
Specifies the AttributeName.

Return Value

The GetAttribute method returns a String variable.


Remarks

In Visual Basic, attempting to access a nonexistent Attribute will cause a run-time error. Therefore, it is recommended to include an On Error statement trapping such cases.

Example

The following code snippet retrieves the information associated with requested attribute. While the actual values will vary among engines. For the Microsoft speech engine, Microsoft Mary is returned for the nameAttribute. VendorAttribute will be Empty since the VendorPreferred attribute has no additional information associated with it. Even so, VendorPreferred has significance merely if it is present or not. However, an SPERR_NOT_FOUND will occur for FakeAttribute since it should not be present.

Dim objVoice As SpeechLib.SpVoice
Set objVoice = New SpeechLib.SpVoice

Dim objToken As SpeechLib.SpObjectToken
Set objToken = objVoice.Voice

On Error GoTo ErrorHandler

Dim nameAttribute, vendorAttribute, fakeAttribute As String
nameAttribute = objToken.GetAttribute("Name")
vendorAttribute = objToken.GetAttribute("VendorPreferred")
fakeAttribute = objToken.GetAttribute("FakeAttribute")
Exit Sub

ErrorHandler:
	'Error handling code here
	Debug.Print Err.Number
End Sub


You are reading help file online using chmlib.com

If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web