Sebastian Brand

About productivity, business and software development.

Wednesday, March 10, 2010

The Notes Add-in for Outlook

Another week, another product!

My lovely wife had the requirement to put notes to her appointments in the Outlook calendar that only she would see. I took a round of Google and decided to write an add-in for Outlook :-)

A couple of days later, the Notes Add-in for Outlook was done. It adds a button in the command bar of messages and appointments. The button opens a note item and links the message/appointment to that note item. When re-opening the message/appointment to note item is displayed as well. I also made the note item to appear fixed to the right side of the window.

Here's some video:





If you are interested in the add-in, get the download from product website http://www.instyler.com/outlooknotes

If you have an idea that makes it into the add-in I'll be happy to give you a free license.

Labels:

VSTO: Using .NET multi-language support in Office add-ins

Visual Studio and the .NET framework offer a nice option to localize Windows Forms, Office Ribbons or resources in general. For example, to localize a form, open the form, set Localizable=True from the properties, choose a language from the Language property and start changing anything on the form. You'll notice an additional .xx.resx file is being created for each language.

During InitializeComponent(); the ResourceManager class is used to localize the form to the current language. To be exact, by current language I mean the current thread's culture. You can change the language of your application or module by changing the Thread.CurrentThread.CurrentUICulture property to another culture.

So far so good. When developing Office add-ins you will notice that this does not use the current language of Office, but the Windows system language. The trick is to set the CurrentUICulture to the Office language:

private void ThisAddIn_Startup(object sender, System.EventArgs e) {
   Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(this.Application.LanguageSettings.get_LanguageID(Microsoft.Office.Core.MsoAppLanguageID.msoLanguageIDUI));     
}
           
Voila, all dialogs appear in the Office language now, except ribbons. Ribbons are created before ThisAddin_Startup happens, so you'll have to set the language in the ribbon's constructor, before InitializeComponent(); of those ribbons. Unfortunally, there is no Globals.ThisAddin.Application available yet, so you'll have to get the Office object another way.

With the help of genius Helmut Obertanner from outlooksharp.de I found a rather simple solution: Create a new Outlook.Application() 

Here's the code of my ribbon's constructor:

public MyRibbon() {
   Outlook.Application app = new Outlook.Application();
   Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(app.LanguageSettings.get_LanguageID(Microsoft.Office.Core.MsoAppLanguageID.msoLanguageIDUI));               
   InitializeComponent();
}

That's it.

Labels: , ,

Thursday, February 18, 2010

Switch off your monitor

I often have a situation at my workplace where I'm leaving my computer without shutting it down or putting it in standby mode because something important is still running or because I'm just to lazy. Instead I'm just leaving it on. With all monitors.

Modern workplaces often feature more than one monitor and often they are large and therefor power consuming. Wouldn't it be great to have a "Switch off monitors" function?

The tool for that is Wizmo from Gibson Research. It allows you to switch off all monitors via command line. Best of all it's free and comes as just one exe file.

I created a shortcut on my desktop to call 
wizmo.exe monoff
That's it. Now I'm saving a few watts of power ;-)

Labels: ,

Thursday, February 11, 2010

HP ML110 G6 with more than 8 GB RAM

As a new server machine, I got a nice HP ML110 G6 (585458-045) with a Quad-Core Xeon X3430 (no Hyper-Threading). This is low cost entry server for small and medium businesses.

I was experienced with the ML110 series since G3 but this new version has one major flaw: No RAID. In fact the on-board SATA controller does not feature any basic hardware RAID. You either have to buy a different server, another SATA controller PCI card or use Software RAID.

Officially the server only supports 8 GB RAM (DDR3 ECC 1333 MHz) but I use the 4 GB modules from Kingston (KVR1333D3E9S) which would max it to 16 GB. The modules work fine, although I can only test it with 2 x 4 GB plus to original supplied 1 GB module making it a total of 9 GB now.

Stress tests running now :)

Labels: