Browse by Tags

All Tags » Code (RSS)

2008 Scripting Games - My solutions

Here are my solutions to the 2008 Scripting Games scripting competition. This is a rather large post but I decided one post would be better than posting them all individually, this way they will all be in one place when I want to find them later. I had...

All Outlook object model calls run on the main thread

While writing an Outlook addin, lots of people feel that they should try to help with Outlook performance by running their addin code on a background thread. While this can help in some scenarios it can actually make things worse in others, particularly...

Issues with the XmlSerializer in medium trust environments

In my last post I briefly mentioned that CodeHTMLer had issues running in a medium trust environment. The simple web application front end I created kept failing before it ever got started. It keep hitting a SecurityException nested in an InvalidOperationException...

Fun with C# functions

Dustin Campbell has an interesting series on C# functions on his Did it with .NET blog. Fibonacci Numbers, Caching and Closures What's in a Closure? Using Automatic Memoization A Higher Calling The Art of Currying Building Functions from Functions, part...
Posted by puzzlehacker | with no comments
Filed under: ,

Failure creating an Outlook application object on Vista

While creating a Outlook application object from another process in C# like: outlook = new Microsoft.Office.Interop.Outlook.Application(); or powershell PS > $outlook = new-object -com Outlook.Application or straight up COM via CoCreateInstance on...
Posted by puzzlehacker | 5 comment(s)
Filed under: , ,

Why does my Outlook event seem to stop working?

Imagine we have some code in an Outlook addin that looks similar to code below. Does anyone see anything wrong with it? It simply places a button on the menu bar and shows a message box when the button is clicked. The code works for sometime but then...
Posted by puzzlehacker | 5 comment(s)
Filed under: , ,

Powershell script to find strings and highlight them in the output

After reading about Brad 's find script I starting thinking about how cool it would be if I could highlight the search pattern in the output. So I wrote my own custom Find-String script to highlight the results. Find-String.ps1 # Find-String.ps1 # Wrapper...
Posted by puzzlehacker | 2 comment(s)
Filed under: , ,

Retrieving your Outlook appointments for a given date range

Before we dive into the code sample lets take a quick look at what it means for an appointment to fall into a given date range. When you compare an appointment with a given date range (or any two time intervals) there are the 6 possible outcomes displayed...
Posted by puzzlehacker | 6 comment(s)
Filed under: , , ,

Powershell version of cmd set

If you are like me and are just so used to typing set to list and set environment variables then you might find this script useful. if ( test-path alias:set) { remove-item alias:set > $null } function set { [string] $var = $args if ( $var -eq "" )...

How do I access my Outlook contacts from my web application?

Question How do I access my Outlook contacts from my web application? Short Answer You don't, well at least you shouldn't (It is theoretically possible to access Outlook data from a web application, assuming Outlook is installed and the profile...
More Posts Next page »