Posts Tagged ‘Object model’

How To: Get a list of Outlook attachments

As a developer, sometimes you may want to know what is attached to the e-mail you have selected or opened in Outlook. Today I will show you how to iterate over the attachments collection and get the required information about attached items, such as file name, display name and type... Read the rest of this entry →

How To: Add an existing Outlook e-mail message as an attachment

Now I want to show you how to attach an e-mail instead of a regular file. For such task I created a simple method in the code called AddMessageAsAttachment. This method attaches a MailItem object to the e-mail message and accepts two parameters: the first is the container e-mail message and the second one is an e-mail message which should be attached... Read the rest of this entry →

How To: Add an attachment to an Outlook e-mail message

Sometimes developers need to create an add-in, which automatically sends reports based on some rules. The report can hold one or more attachments with the data the recipient needs. Today I will show you how to attach something to the e-mail message programmatically... Read the rest of this entry →

How To: Respond to an Outlook email programmatically

Several Outlook item types provide the Forward, Reply and ReplyAll methods. Let's see how to respond to an Outlook.MailItem... Read the rest of this entry →

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 →

Have any questions? Ask us right now!