You don't even need a dll for that, a COM object can do the job. Check out this very nice snippet.