views:

186

answers:

1

I've got an Outlook VBA script which calls on a custom dll to perform a particular function. The assembly is compiled to be COM visible, but is not strong named due because of a myriad of dependencies, and thus is not registered in the GAC. To work around that, I've simply placed the assembly and it's dependencies in the appropriate Program Files location where outlook finds them. No problem.

The problem is when my script executes, it's throwing the following error:

Run-time error '-2147467261 (80004003)' object reference not set to an instance of an object

Here's the code:

Sub ProcessEmails(Item As Outlook.MailItem)
    Dim oWikiPosterTool
    Set oWikiPosterTool = CreateObject("WikiScript.WikiPoster")

    Dim strID As String
    Dim objMail As Outlook.MailItem

    strID = Item.EntryID
    Set objMail = Application.Session.GetItemFromID(strID)

    Call oWikiPosterTool.PostMailItem(objMail.Body, objMail.SenderEmailAddress, objMail.SentOn)
End Sub

Basically, the assembly (C#) handles the posting to data up to a wiki. I'm simply trying to pass the basic information from the email on to the assembly method so it can do it's work. When the outlook sub gets to the Call line, however, it throws the error.

Strangely, though, when I examine the objects involved, none are null.

IsNull(oWikiPosterTool) returns False
IsNull(objMail) returns False
and so on...

Is this error telling me that my assembly is having an issue, or is it an issue in the script as well? Disclaimer: I know virtually nothing about VBA and have hacked this together the best I can.

Thanks!

A: 

I figured this out - it was the COM assembly that was throwing the error.

patjbs