Thread: STA mode Error
View Single Post
  #1  
Old May 14th 09, 03:44 PM posted to microsoft.public.outlook.program_addins
Matt
external usenet poster
 
Posts: 119
Default STA mode Error

Hello,

I wasn't getting this error until I threw my code, which initiated/called my
Form to load, into a try/catch statement.

"Current thread must be set to single thread apartment (STA) mode before OLE
calls can be made. Ensure that your Main function has STAThreadAttribute
marked on it."

I don't have a Main function in my code for my COM add-in for Outlook, so
how would I go about fixing this error so that I can load my Form.

Thanks
Ads