How to retain alternate data stream associated with a word document while converting it to newer file format version

Recently I encountered a not so common [;-)] scenario while working with Word 2007: If you have a Word 97-2003 format document which also has an alternate data stream associated with it, converting this document to the newer file format (DOCX file format) in Word 2007 may result in the loss of the associated alternate…

0

Using shortcut keys to call a function in an Office Add-in

Recently I came across a problem where a customer was looking for the ways to call a function in an VSTO office add-in using keyboard shortcuts. Since I could not find good documentation on it, I decided to document my findings. One can implement these in following ways: 1.    Use KeyBindings 2.    Hook the main…

2

How to implement late bound event handling in case of a VSTO Add-In

If you build a managed component that loads into Office application’s(Word, Excel , PowerPoint) process space, and the managed code uses the PIA (or a custom IA using event delegates) to sink events on the Application object, that application’s instance may encounter problems when used for OLE embedding. The problems include: Being unable to update…


How to set the editing restrictions in Word using Open XML SDK 2.0

Recently I worked on a scenario where customer wanted to set the Document Editing Restrictions in Word 2007 using Open XML SDK 2.0. Document Editing Restrictions is nothing but Review | Protect Documents | Restrict Formatting and Editing option in MS Word 2007. It allows you to set different types of protection like  Readonly, Track…

4

How to Delete a Worksheet from Excel using Open XML SDK 2.0

Update (8 Feb 2013):- The sample code has been fixed for issues where it did not correctly delete all defined names and calculation cells. Recently I worked on a scenario where a user wanted to delete a worksheet from a workbook using Open XML SDK 2.0. The worksheet may  contains some formulas, defined names, pivot…

8