Question app that reads outlook error

lleemon

Member
Joined
Apr 13, 2006
Messages
7
Programming Experience
3-5
I am working with visual studio 2010 on a windows 7 pc and I have created an application (Platform: Active(x86)) that reads my Outlook 2010 as expected. I compiled and then installed on destination server. When I run it I get the following error:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

If I click the 'Continue' button the form loads but it doesn't run get a list of info from Outlook at is expected. It appears this has something to do with my local outlook version versus the server outlook version.

How do I develop for a previous version of Outlook if I do not have it installed on my development pc?

-------------------
ENVIRONMENT INFO
-------------------

My development setup:
Windows 7 Professional SP1
Processor: i7-2600k @3.40GHz
RAM: 16GB
System Type: 64-bit OS

Visual Studio 2010 version 10.0.40219.1 SP1Rel

Outlook References available:
-Microsoft.Office.Interop.Outlook v12 (v1.1.4322 runtime)
-Microsoft.Office.Interop.Outlook v14 (v2.0.50727)

-------------------
Production server / application destination:

Server: Microsoft Windows Server 2003, Standard Edition
Version: 5.2.3790 SP2
System Manufacturer: Supermicro
System Model: X7DVL
System Type: X86-based PC

Microsoft Office Outlook 2003 (11.8169.8172) SP3


Thanks in advance.
 
How do I develop for a previous version of Outlook if I do not have it installed on my development pc?
You can install the PIA for that version, reference it and write code using it, so you can see if the types/members are available for that version.

Late binding is explaned here: How To Use Visual Basic .NET for Binding for Office Automation Servers
For targeting multiple versions with a single app you would start with writing the code for early binding, keeping in mind compatibility with different versions, and when it was complete and working you would make a copy where references is removed and types is replaced with Object type for late binding. As for maintainability perhaps it would be better to write one strongly typed app for each Office version.
 
Thanks. I found Microsoft Office 2003 PIA but I see that you have to have the Microsoft Office 2003 software installed.

Guess I was looking for a solution where I don't need to install Office 2003 on my development box. Am I missing something where I can install a PIA without the base code?
 
The interop libraries provides a managed interface for the .Net program. You don't need Office installed to write automation code using the interop libraries. At runtime however your calls to the interop types is being redirected to the actual unmanaged Office automation servers, so they must be present for that. Whether the 2003 PIAs can interact with newer Office I don't know, just try/research that. Given the late binding functionality, any compatible types and calls can be made to any Office version from late bound code.
 
Thanks JohnH. The problem I have is when I try to install the 2003 PIA on my local pc it says it will not install anything until I have Office 2003 installed. Am I doing this wrong, do I need to install the 2003 PIA on the server and then extract the dll's to my local pc?

Guess I will have to try bind code.

Thanks.
 
Really? I haven't had any problems before installing PIAs without having any Office installed. It may sound strange that I've actually done that, but I do that sort of thing all the time.
 
Yes, it's frustrating. Are you installing the O2003PIA.msi? Or something else? The message I get when I try to install is, "Please install Microsoft Office 2003 before installing this product." Wish I could find a work around.
 
It was an official Office PIA redistributable, I'm sure of it, and it was to a computer that didn't have any Office installed prior to that.
 
Kind of wondering if Microsoft changed this.

According to Patrick Smith: Microsoft InfoPath he states the following:
Important Issues to keep in mind:

This MSI is designed to contain all of the PIA's which shipped with Microsoft Office System 2003. The product PIA's will only install if the parent product is installed on the machine.
Leave the PIA redistributable on the machine once it's installed. Because this product is redistributable, many add-ins could ship it. The MSI will only install once and then subsequent installs would just see that it's already on the machine. Removing it via Setup logic will remove it for everyone. The current recommendation is to leave uninstallation of the PIA Redistributable to the end user through Add/Remove Programs.
 
Back
Top