Monitoring when registry keys are modified

Let’s say you want to see where a certain setting from Word Options is saved in Registry.   The easiest method is using Process Monitor. Add a filter on Process Name and Operation, start Word and that’s that:  If we uncheck “Allow background saves” from Word Options – Advanced – Save, this is what appears in Process Monitor:…


Back to school – Office art geometry

Let’s start off with the following observation- the following two shapes have the same Left and Top coordinates:   What’s different is obviously the rotation. What Office saves for a shape is the Left and Top coordinates together with a Rotation. So the Top coordinate, for instance, is not necessarily the uppermost part of a shape….


Using DDE in C# for Office automation

  Looking for some code samples how to pass DDE messages from a .NET program I found out that there‘s a great library already in place that facilitates working with DDE: the NDde project from Codeplex: However, I just needed to make one call and including a new DLL into my code would have…


Using .NET library in VBA

Three easy steps for exporting .NET functionality to VBA: 1. Write a source file:   using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Windows.Forms; namespace InteropTest { [Guid(“BEB2C62D-5646-4B08-81DF-670314BFEE4A”)] public class InteropTestClass { public void Help() { MessageBox.Show(“Hello From .NET!”); } } } The GUID needs to be unique. 2. Generate a strong…


Recovering the pictures from a PPT file

  The PPT file format is very well documented as per Microsoft’s Open Specification Promise. However, accessing any part of a PPT file isn’t really a snap. I’ve created a small C# program which parses the \Pictures stream from a PPT file. For that, one needs to: Extract the Pictures stream from the PPT OLE…


Complex editing of XLSX files

  Editing Excel OpenXML documents using the OpenXML 2.0 SDK offers better performace and improved supportability compared to normal Office automation (e.g. VBA). There are also great examples on the Internet to get started: Office Open XML Formats: Inserting Values into Excel 2007 Cells. What I haven’t found until now is some clarifications as to…


Indenting XML files

  The operation of indenting XML files is pretty trivial when using the classes from the System.XML namespace. However, I often find myself trying to read canonical XML code from files. As such, a created a very simple tool that converts XML files to indented XML. All you need to do is to drag and…


List styles in Word document with preview

  The sample code from my previous post does a pretty good job listing the styles in a Word document. However, having a preview of these styles makes it a lot easier to spot the subtle differences than by using the Description object. For generating a preview of the styles I used some code posted…


Listing styles in Word document

  When dealing with Styles in Word you can never have too much control. This is when a listing of the existing styles and their descriptions helps a lot. Happily VBA provides a powerful way of getting details about a certain style through the Description member of the Style class. Based on this I’ve built…


Brushing up on the WPF and Windows 7 Jump Lists

  This is just a summary on the new Windows 7 features and how these can be implemented in .NET. There is plenty documentation on both Windows Presentation Foundation and the Windows 7 SDK but actually implementing a solution is a bit harder. So here we have it: a WPF application that create Jump Lists…