4 captures
30 Mar 2016 - 5 Oct 2018
Jun OCT Nov
05
2016 2018 2019
success
fail
About this capture

11.1.1.3. Felix COM API Code Samplesยถ

This page contains code samples to illustrate the use of the COM API.

11.1.1.3.1. Look up a Queryยถ

This will look up a query in the Felix window:

Dim felix As Object
Set felix = CreateObject("Felix.App")
felix.LookUp "My query"

11.1.1.3.2. Get Translation Infoยถ

This will print out information about the match suggested for the current query:

Dim felix As Object
Set felix = CreateObject("Felix.App")

Debug.Print "Number of matches:" & felix.NumMatches
Debug.Print "Score: " & felix.Score
Debug.Print "Translation: " & felix.trans

11.1.1.3.3. Set the Translation for a Queryยถ

Here, we will look up a sentence, and then provide a translation:

Dim felix As Object
Set felix = CreateObject("Felix.App")
felix.LookUp "My query"
felix.Trans = "This is the translation"

11.1.1.3.4. Merge Two TMsยถ

Hereโ€™s a slightly more involved example. Here, weโ€™ll load two TMs, merge them into a single TM, and then save it with a new name:

Dim felix As Object
Set felix = CreateObject("Felix.App")

' load the two mems
Dim mem1, mem2 As Object
Set mem1 = felix.App2.Memories.Load("c:\mem1.ftm")
Set mem2 = felix.App2.Memories.Load("c:\mem2.ftm")

' Now add all the records in mem2 to mem1
For Each record In mem2.Records
    mem1.AddRecord record
Next record

' Finally, save the mem with a new name
mem1.SaveAs "c:\merged.ftm"