views:

66

answers:

1

I can't seem to find a thing on what this exception code indicates on Google or MSDN, and it's occurring intermittently and without a pattern I can discern. Has anyone run across this before? The failure seems to occur on the final line here:

Dim olApp As New Outlook.Application
Dim olNS As Outlook.NameSpace = olApp.GetNamespace("MAPI")
Dim olMail As Outlook.MailItem = olApp.CreateItem(Outlook.OlItemType.olMailItem)

Any help would be appreciated.

A: 

Looks like you haven't created your olApp object.

Set olApp = CreateObject("Outlook.Application")

This link should help you out: http://support.microsoft.com/kb/220595

Chris Persichetti
Thanks, but I'm not sure this is it. I was using "New" to declare the Outlook app, and that does seem to create it fine in most cases. I'll try changing it to that syntax and see if the error still occurs.
Todd
No luck, unfortunately. Thanks for the idea though.
Todd