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: SpObjectTokenCategory
Type: Hidden

GetDataKey Method


The GetDataKey method returns the data key of the SpObjectTokenCategory object.

A data key object provides read and write access to the contents of a particular folder in the Speech configuration database. The data key of an SpObjectTokenCategory object accesses the folder referenced by its Id property.


SpObjectTokenCategory.GetDataKey(
     [Location As SpeechDataKeyLocation = SDKLDefaultLocation]
) As ISpeechDataKey

Parameters

Location
[Optional] Specifies the location in the speech configuration database. Default value is SDKLDefaultLocation.

Return Value

An ISpeechDataKey object.


Example

The following Visual Basic form code demonstrates the use of the GetDataKey method to enumerate the list of voices in the voices category. To run this code, create a form with the following controls:

  • A list box called List1
  • A command button called Command1
  • Paste this code into the Declarations section of the form.

    The Command1 procedure creates a new SpObjectTokenCategory object, and uses the SetId method to associate the object with the category of voices. It retrieves the data key of the category, and then the data key of the category's Tokens subfolder. It then uses the data key object's EnumKeys method to enumerate the tokens in the Tokens subfolder. The result displayed will be identical to the lists of voices displayed by the code sample in the EnumerateTokens method.


    Option Explicit
    
    Dim C As SpeechLib.SpObjectTokenCategory    'a category of object tokens
    Dim K As SpeechLib.ISpeechDataKey           'data key object
    Dim E As String                             'gets names of subkeys
    Dim ii As Integer
    
    Private Sub Command1_Click()
    
        List1.Clear
        List1.AddItem "Enumerate voice tokens with SpObjectTokenCategory.GetDataKey"
        List1.AddItem ""
    
        Set C = New SpObjectTokenCategory   'create new token category object
        C.SetId SpeechCategoryVoices        'init with ID of voices category
        
        Set K = C.GetDataKey                'set to key of voice category object
        Set K = K.OpenKey("Tokens")         'reset to key of its "Tokens" subfolder
        
        On Error Resume Next
        For ii = 0 To 9999                  'enumerate subkeys within "Tokens" subkey
            E = K.EnumKeys(ii)              'next subkey
            If Err.Number Then Exit For     'this will be used!
            List1.AddItem "   " & E
        Next
        Err.Clear
        
    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