Apologies for my poor understanding of references/COM/dlls.
I have a VB.Net application without Option Strict. It uses the code below to send lotus emails.
Dim s As Object = CreateObject("Notes.Notessession")
Dim db As Object = s.GetDatabase("", "")
Call db.openmail()
doc = db.CreateDocument
doc.ReplaceItemValue("SendTo", "someEmail@someEmailSpot.com")
doc.ReplaceItemValue("Subject", "Some subject text")
doc.ReplaceItemValue("Body", "Some body text")
Call doc.Send(False)
When I recreate the code with Option Strict the
Dim db As Object = s.GetDataBase("", "")
line has a late binding error, under s.GetDataBase, which I don't know how to resolve. I can't find a reference to add to my project so that I can cast it to a Notes.Notessession.
I was instead able to use the following reference -- "Lotus Domino Objects" Interop.Domino.dll -- to write the code below.
Dim session As New Domino.NotesSession
session.Initialize()
Dim dir As Domino.NotesDbDirectory = session.GetDbDirectory("")
dir.OpenMailDatabase()
Dim db As Domino.NotesDatabase = dir.OpenMailDatabase
Dim doc As Domino.NotesDocument = db.CreateDocument
doc.ReplaceItemValue("SendTo", "someEmail@someEmailSpot.com")
doc.ReplaceItemValue("Subject", "Some subject text")
doc.ReplaceItemValue("Body", "Some body text")
doc.Send(False)
The problem is it seems Domino.NotesSession requires me to provide a password where Notes.NotesSession did not, either as a parameter in initialize or in a prompt that is created if no password is passed, like the code above.
My questions are:
Is there a way for the Domino.NotesSession object to initialize without needing a password, like the Notes.NotesSession object does?
What is being referenced at runtime to create the Notes.NotesSession object, and how can I add this reference at design time?
Is there a view to view what type of object something has late bound to at runtime? Presumably in the first code block, s is being binded to a Notes.Notessession, but viewing it in watch or using TypeOf just return a generic "_ComObject".