Posts Tagged ‘Object model’

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 →

HowTo: Support Office 2007 color schemes in your custom forms and task panes

In Office 2007 there are 3 available color schemes – Black, Blue and Silver. The background of controls in command bars and ribbon tabs is changed by Office automatically. Do you want to try changing the background of your Outlook forms and Excel task panes when the MS Office color scheme is changed?... Read the rest of this entry →

HowTo: Work with threads in Microsoft Office COM add-ins

It is generally known that the Microsoft Office Object Model is not thread safe and accessing some object, property or method not from the main thread may sometimes result in a host application crash. Of course, nothing prevents you from using threads inside the add-in itself, threads that don't need the Office Object Model... Read the rest of this entry →

HowTo: Customize Outlook Navigation Pane – C#, VB.NET

What is the Outlook Navigation pane? According to Microsoft, it is the column on the left side of the Outlook window that includes panes such as Shortcuts or Mail and the shortcuts or folders within each pane. The Navigation Pane was introduced in Outlook 2003 and enhanced in Outlook 2007. Let's see what a developer can do with the Navigation Pane... Read the rest of this entry →

HowTo: Use the Microsoft Word Object Model capabilities for spell checking

The Microsoft Word Object Model contains a lot of capabilities that .NET developers can benefit from. While everybody knows about the abilities of Microsoft Word related to text formatting, few are aware of its rich capacity in the spell check area…... Read the rest of this entry →

HowTo: Get properties of an Outlook email item drag-and-dropped onto a .NET form

There is only one simple and reliable way to get a valid Outlook object when dragging Outlook items onto a .NET form of your Outlook add-in. Let's have a good look at this way by example of MailItem and an advanced Outlook form region...... Read the rest of this entry →

HowTo: Use the View.XML property to filter Outlook items

The View object itself is simple but it has one very powerful property. This property is called XML, it contains an xml definition of a folder view and today we are going to look at the capabilities of the filter element…... Read the rest of this entry →

HowTo: Search in Outlook items programmatically

You can search in Outlook in three different ways – by using the Items.Restrict method, Items.Find in liaison with Items.FindNext and Application.AdvancedSearch. The first two have essential limitations in use…... Read the rest of this entry →

HowTo: Deal with the Recipients collection in Outlook

Well, it’s all about Outlook again. Today we will look at the capabilities of the Recipients collection, Recipient and AddressEntry objects. Using these objects you can get all necessary information about recipients, and you can also modify their e-mail addressees...... Read the rest of this entry →

HowTo: Fix “Old format or invalid type library” error (0x80028018)

Today I’d like to draw your attention to one specificity of the Excel Object Model that every .NET developer should be aware of. Those who are unaware, may get the notorious "Old format or invalid type library" error...... Read the rest of this entry →

HowTo: Handle the Outlook ItemSend event: C#, VB.NET examples

One of the most frequent questions we get concerning the Outlook Object Model is "How to handle the Send button event?" Here is the answer: "You need to use the Application.ItemSend event"...... Read the rest of this entry →

HowTo: Store Microsoft Office documents in your custom data storage

One of the tasks that developers often run into is saving and retrieving Office documents (or document copies) from external data storage. This storage can be an SQL database, Web-service, FTP server as well as a shared network resource of a local area network. Let’s try to handle this task for such popular MS Office applications as Word, Excel, PowerPoint and Outlook…... Read the rest of this entry →

HowTo: Exchange Data using the Outlook Attachments collection

Normally Outlook developers use the MailItem.UserProperties collection to send and receive some additional information with email messages. In this sample add-in for Microsoft Outlook, I suggest a slightly different approach ...... Read the rest of this entry →

Have any questions? Ask us right now!