We have a WinForms app, written in VB.NET (CLR 2.0), that does a lot of Outlook-related stuff. One of the things we do is programmatically open up a new Outlook 2003 'compose new Email' form, pre-populated with the 'to' address.
Me.WordApp = New Word.Application Dim template As Object = System.Reflection.Missing.Value Dim newTemplate As Object = System.Reflection.Missing.Value Dim documentType As Object = Word.WdNewDocumentType.wdNewEmailMessage Dim visible As Object = False Me.WordDoc = Me.WordApp.Documents.Add(template, newTemplate, documentType, visible) 'then some other stuff
Now, this works perfectly almost everywhere we deploy the application – the user fills in the email subject and text, clicks send, and we can catch the Send event and do other good stuff.
There are just a couple of installations where it breaks, and we just can't get to the bottom of it.
Does the following give any indication of where the problem might be:
Could not load file or assembly 'office, Version=188.8.131.52, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
As far as we can tell, these are just Office 2003 installations, with Outlook and Word, just as in the cases where it works fine.
I'd be very grateful for any ideas – either on how to fix this, or on a better way of achieving the same thing.