I am looking for a way to attach a file to an email in Microsoft Outlook programmatically using Visual Basic. (I'm using Visual Studio 2017) The address is a static one. I have found this code here on EE and it looks like the solution but I am unsure of how to reference Outlook.
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
olApp = New Outlook.Application
olMail = olApp.CreateItem(Outlook.OlItemType.olMailItem)
olMail.Subject = "Your subject"
olMail.HTMLBody = "Your HTML text"