Outlook 2007 from C# - COM exception, TYPE_E_LIBNOTREGISTERED

后端 未结 4 1239
情书的邮戳
情书的邮戳 2020-12-06 12:01

I\'m trying to make a program that would open new Outlook 2007 message.

I\'ve referenced from COM tab Microsoft Outlook 12.0 ObjectLibrary.

These items showe

4条回答
  •  春和景丽
    2020-12-06 12:47

    Had the same problem with the following code:

    Dim OutlookMessage As Outlook.MailItem
    Dim AppOutlook As New Outlook.Application
    OutlookMessage = AppOutlook.CreateItem(Outlook.OlItemType.olMailItem)
    

    Replacing the first line with the following solved it for me.

     Dim OutlookMessage As Object
    

    (sample in VB but same should apply to C#)

提交回复
热议问题