Creating a Loader Add-in (Master Add-in)

I have now helped about half a dozen customers over the last 3 years to perform this very same task. In each case the scenario is the same:

  • They have documents that are very specific to their system
  • They want to create an add-in to assist with the management of these documents.
  • They only want the add-in to load when one of their document is opened.
  • BONUS: They also want to remove other add-ins
  • BONUS: They would like a pristine instance of Word or Excel.

There are several methods to accomplish each of these tasks. But the one I find is easiest to maintain is what I call the “Master Add-in” approach.

In the “Master Add-in” you essentially attach one event: DocumentOpen or WorkbookOpen. You place code in the event to detect whether it is a document you care about. This can be done in several ways:

  • You can look at the path where the file came from.
  • You can look at the name of the file, if there is a specific naming convention you follow.
  • Or, you can tag he document with Document Properties or Custom Xml Parts.

Once you have identified that it is a document you care about you follow this basic process:

  • Get the path to the file being open and store it.
  • Close the workbook or document being passed into the Open event.
  • Create a new Instance of Word or Excel.
  • Iterate through the COM Add-ins collection and the Add-ins collection and disable everything you do not want running. This includes disabling the Master Add-in as you do not want it running for the next parts.
  • Locate your COM Add-in in the collection and set Connect = true.
  • Open the document or workbook from the application object.

You will now have two instances of Excel or Word open. One that the user was originally working with which has the Master Add-in loaded and then the new one that is customized with your specific add-in and only your add-in.

This is useful for when you have multiple versions of your system and you can update the Master to recognize which version to launch.

Getting this to work just right is sometimes a challenge and you have to be careful not to disable all the add-ins for all instances. I have a few customer examples that I have built and will work on cleaning them up. I will combine the best parts and will write a new entry in the future which will walk you through creating one.

Outlook Calendar Cleaner

I encountered an odd problem while working with a customer that was porting from Lotus Notes to Office 365 (Exchange) and ended up creating a new tool called the Outlook Calendar Cleaner.

The customer had a mixed environment of Mac and Windows and in certain conditions appointment items were disappearing on the Mac Office Outlook calendar, but still appearing in Outlook Web Access (OWA) and if the delegate was in Windows, they would still see the appointment on their view of the owners calendar.

The issue turns out to be that in the conversion a multi-line subject in an appointment item (supported in Lotus, but not in Exchange), has the new line character converted to a start of text (SOT) character or ASCII code 0x02. The problem is that this is an invalid character in XML and the Exchange Web Services implementation on Mac O/S X does not properly parse this character. This causes the process to hang and all appointments which were being imported on that thread are not copied over. Net effect – they appear to be missing in Mac Outlook.

So, I created a tool to correct the problem. The Outlook Calendar Cleaner is a very specific tool targeting this problem. You can to open the users Exchange Account (Office 365 account) in Outlook 2010 for Windows and run the tool in Windows and it will clean any appointments found to have this special character.

I have posted the Outlook Calendar Cleaner tool on Codeplex (along with the source code). Here:

Outlook Calendaring Issues with BPOS (Office 365)

The other day I got a Microsoft BPOS/Outlook issue (NOTE: BPOS is now called Office 365). Certain, heavy calendar users were experiencing a lot of issues. Here were the primary items:

  • Lag when switching between Delegated calendars/ inboxes etc.
  • Appointments not updating correctly.
  • Message interface error when switching between calendars
  • New event on calendar, no details shown
  • Duplicate entries on Calendar
  • Unable to determine who’s calendar you are viewing when using “calendar in Mail” view. The name was not listed on the tab.

Most of the problems occur because Outlook is not configured to work over a slower than usual connection. BPOS uses a login client that then connects to the “cloud” servers run by Microsoft. When running Exchange server on premises, you can rely on your 100MB network connection and not worry about bottlenecks occurring for certain heavy network operations. However, when using the advanced calendaring features of Outlook, it can put a strain on your ISP connection (upload/download is usually far less than 100MB). The core of the solution is outlined in this support article:

What you need to do is turn on the option to Cache Others Mail. This is not enabled by default and you should NOT set this for all users, JUST your heavy shared calendar users (like Administrative Assistants):

  1. Exit Outlook 2007.
  2. Start Registry Editor: Click Start, click Run, type regedit in the Open box, and then click OK.
  3. Locate and then click to select the following registry key:  HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Cached Mode, or you can use: HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\Outlook\Cached Mode
  4. Right-click CacheOthersMail, and then click Modify.
  5. Type 1 in the Value data box, and then click OK.
  6. On the File menu, click Exit to exit Registry Editor.
  7. Next, disable headers. To do this, follow these steps:
  8. On the File menu, and then click Cached Exchange Mode.
  9. Click to clear the following options:
    • Download Headers and then Full Item
    • Download Headers
    • On Slow Connections Download Only Headers

Additionally, the following article is a set of best practices for managing calendars. Some of the issues, like duplicates or cancellations not being accepted are likely due to appointments being modified, changed or the original e-mail request being moved, etc. The following article is an excellent resource to make sure appointments are handled properly to avoid issues:

This article describes the following scenarios in which Calendar items may be removed from the Calendar:

  • Multiple users receive meeting requests for a mailbox owner.
  • You delete a meeting request on one computer after you accept the same meeting request on another computer.
  • You cancel or delete a meeting without sending an update.
  • You frequently change recurring meetings.

This article also describes the following scenarios in which the Calendar items may become out of date:

  • You forward a meeting request.
  • You use Outlook Web Access to accept a meeting.
  • You do not click "Send Update" when you change a meeting that you organize.
  • You do not process a meeting request in the Inbox.

Finally, this article recommends the following best practices for working with meeting information:

  • Convert an existing appointment to a meeting request.
  • Do not forward meeting requests if you are not the meeting organizer.
  • Limit the number of delegates who have access to your Calendar.
  • Schedule end dates on recurring meetings.
  • Turn on Calendar logging for executives and for other frequent users.

Additional issues you may be having can be resolved by installing the latest set of patches called Cumulative Updates for Outlook and Office core (mso). The following website has a link to all of these patches:

Update Center for Microsoft Office, Office Servers, and Related Products