Archive for December 4th, 2010

Felix tip: Use a macro to give Felix focus

Dec. 4th 2010

The latest version of Felix (1.6.4) has an expanded COM API. One of the new things you can do with this API is control the size and focus of the memory and glossary windows.

As an example, here is a Word macro that will raise Felix to the top of your screen, while keeping the keyboard focus in Word. This is useful if you return to Word after an internet search, etc., and don’t want to go searching around for the Felix window.

Sub ActivateFelix()

    Dim felix As Object
    Set felix = CreateObject("Felix.App")
    felix.Visible = True
    Call felix.app2.MemoryWindow.Raise

End Sub

Now if you assign a keyboard shortcut for this (in Word 2010, it would be File >> Options >> Customize Ribbon >> “Customize” keyboard shortcuts button, then select Macros >> ActivateFelix >> “your keyboard shortcut”).

You could also create a “document changed” event handler, so that every time Word gets focus, Felix is raised to be visible. The code for this is a bit too involved for this blog post, but you can see the Microsoft documentation for how to write document event handlers.

In a future release of Felix, I plan on making functionality similar to this (also remembering the widow sizes and positions) available as a Felix option.

I’ll be updating the API documentation soon with all the new stuff, but for the meantime, here are the APIs for the memory and glossary windows:

App.App2.MemoryWindow:

  • Raise (method)
  • Left (int)
  • Top (int)
  • Width (int)
  • Height (int)

App.App2.GlossaryWindow:

  • Raise (method)
  • Left (int)
  • Top (int)
  • Width (int)
  • Height (int)
Posted by Ryan Ginstrom | in Felix, tips | 1 Comment »
  • Search

  • Categories

  • Calendar

    December 2010
    M T W T F S S
    « Nov   Jan »
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  
  • Pages

  • Meta