Outlook add-in accessviolationexception setting Body property

  • Thread starter Thread starter Rick Shuri
  • Start date Start date
R

Rick Shuri

I have a VSTO 2005 Outlook 2007 add-in up and running. It uses an Outlook
adjoining form region. This very simple code throws an
AccessViolationException on the "Hello World" line:

private void frEmailAppt_FormRegionShowing(object sender,
System.EventArgs e)
{
if (this.OutlookItem is Outlook.MailItem)
{
_olMailItem = (Outlook.MailItem)this.OutlookItem;
_olMailItem.Body = "Hello World";

}

}

Any ideas? Strangely, it doesn't happen every time!?!
 
So, what's different about when it happens and when it doesn't? Any
differences in the item types?
 
There are definitely bugs in form regions.

I forwarded your post to the program manager for form regions on the Outlook
team and will see what he says, but that won't fix it if it's a bug. That
would have to wait for a hot fix or a service pack. If he asks for more
information I'll post back here.
 
Back
Top