Posts Tagged ‘Object model’

How To: Get any standard / default folder in Outlook

One of the most common tasks in Outlook programming a developer may face is getting a standard folder. Here I will show you how to get it... Read the rest of this entry →

How To: Delete a folder in Outlook

Some time ago I showed a way of creating a folder in Outlook. Now I want to show the reverse operation – deleting a folder. The Outlook Object Model provides the Delete method of the Folder class for such task. It doesn’t accept any parameters and doesn’t return any value. It just does its job!... Read the rest of this entry →

How To: Create a new folder in Outlook

Today I will show you how to create a new folder in Outlook. As you have probably noticed, the Outlook Object Model provides the Folders class... Read the rest of this entry →

How to specify account for an outgoing Outlook message

How to specify account for an outgoing email message in Outlook 2000-2010?... Read the rest of this entry →

How to check programmatically if the user is editing an Excel cell

Here's a typical scenario: your code modifying a workbook fails because the user types something into a cell. Now how to determine that Excel is in the edit mode? ... Read the rest of this entry →

On using threads in managed Office extensions

Briefly: There are cases when using threads in your .NET-based Office add-in is okay; but in the general case, using threads isn't recommended. Consider a typical Outlook add-in scanning a lot of e-mails which should not prevent a user from working with the Outlook UI (the UI always runs in the main thread) ... Read the rest of this entry →

HowTo: Communicate with a COM add-in from a standalone application

In order to get a standalone application to communicate with a COM add-in, the application needs to have access to the running host application (Microsoft Excel in our case), get the COMAddins collection, find a needed instance of the add-in there and use reflection to call public methods or retrieve public properties... Read the rest of this entry →

Outlook Events Logger Add-in – release version

Some weeks ago we published Beta 1 of Add-in Express Events Add-in for Outlook, free add-in or rater tool that can help you learn events in the Outlook 2000-2010 Object Model. Today we have the Release version ready... Read the rest of this entry →

Outlook Fast Shutdown: under the yellow hood

The Fast Shutdown feature found in Outlook 2010 represents a new direction for Microsoft Outlook towards Outlook stability and Outlook integrity. From Microsoft Outlook '97 till Microsoft Outlook 2007, system administrators around the world had to deal with Outlook hanging, Outlook Slow closing, corrupted PST (or OST) files and various Outlook Add-ins that hang for no reason... Read the rest of this entry →

How to show an Outlook.MailItem in PrintPreview mode programmatically

The Outlook object model doesn't allow showing the PrintPreview dialog. To show it in all Outlook versions, you need to call the Execute method of a corresponding command bar button. Also, in Outlook 2007 and 2010, you can invoke the corresponding Ribbon command using the ExecuteMso method of the Office.CommandBars class. Let's see how to do this... Read the rest of this entry →

Outlook 2010 Fast Shutdown feature

Microsoft first attempted to fix at one fling all bugs of all programs and programmers that use the Outlook Object Model when releasing SP2 for Outlook 2007. That attempt was not very successful, and Outlook 2007 SP2 may hang in memory when shutting down the same as all previous Outlook versions. Their second attempt appeared to be much more successful... Read the rest of this entry →

HowTo: Get an attachment size in Outlook 2000 – 2007, part 2

In the previous sample, I showed how to get the PR_ATTACH_SIZE Extended MAPI property that returns the size of an Attachment object. To be more precise, it returns the size of the attached file and the size of some internal info. In most cases that makeweight does not matter at all... Read the rest of this entry →

HowTo: Get an attachment size in Outlook 2000 – 2010, part 1

The new Size property of the Attachment object was introduced in the Outlook 2007 Object Model. There exist at least two methods of getting the attachment size in older Outlook versions... Read the rest of this entry →

HowTo: Use MS Word Object Model to get synonyms and antonyms lists programmatically

In one of my previous HowTo samples I showed you how to use the Microsoft Word Object Model capabilities for spell checking. Today we will look at one more ability of Microsoft Word, namely the capabilities of its dictionary, more specifically synonyms and antonyms. We will need the SynonymInfo object and SynonymList and AntonymList properties... Read the rest of this entry →

HowTo: Avoid limitations of Microsoft Outlook ItemAdd event

The description of the ItemAdd event is laconic and compact - "Occurs when one or more items are added to the specified collection. This event does not run when a large number of items are added to the folder at once." But what is really implied by the words "a large number of items"?... Read the rest of this entry →

HowTo: Convert Exchange-based email address into SMTP email address

It would be true to say "get" rather than "convert". There could be only one right way – to use Extended MAPI. Another method is described in the MSDN article: How to retrieve alternate e-mail addresses by using CDO, but we will not see into this approach, because CDO is optional in Outlook 2003 and is absent completely in Outlook 2007... Read the rest of this entry →

Have any questions? Ask us right now!