Outlook add-in accessviolationexception setting Body property

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!?!
 
K

Ken Slovak - [MVP - Outlook]

So, what's different about when it happens and when it doesn't? Any
differences in the item types?
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top