Jan 19 at 9:06 PM
Edited Jan 19 at 10:18 PM
I am trying to develop a simple outlook project to get some basic knowledge on how NetOffice is used. I am using vb.net in the Visual Studio Community IDE. I have Office 365 installed. I have created references to the NetOffice.dll, OutlookAPI.dll, OfficeAPI
and VBIDEApi.dll. I have not referenced the Outlook 16 object library (Office 365). My code, which was copied from one of the examples is:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' send mail in outlook
' taken from Example03.vb
' start outlook
Dim outlookApplication = New Outlook.Application()
' Create a new MailItem.
Dim mailItem As Outlook.MailItem = outlookApplication.CreateItem(OlItemType.olMailItem)
' prepare item and send
mailItem.Subject = "hello eric"
mailItem.Body = "Season Greetings from NetOffice. Kind Regards - Sebastian"
' close outlook and dispose
The issue that I have is that is that types Outlook.Application() and Outlook.MailItem are not defined. I can fix that by adding a reference to the Outlook 16 object library and Importing Microsoft.Office.Interop but my understanding was that this is not supposed
to be required. Is that correct? It appears that I have missed something. If anyone can point me in the right direction it would be appreciated.