title: Lotus Notes VBA Email Automation - db.CreateDocument Command Fail
body: <p>I'm trying to automate the sending of an email through Lotus Notes 9.0 using VBA. The code will load up notes, which asks for my password but before the password prompt shows up, I get an error. The error I run in to is "Run-time error '-2147417851 (80010105)': Automation Error The server threw an exception" When I hit debug, the line that it fails on is "Set obDoc = obDB.CreateDocument". A lot of what I've seen online example wise matches what I'm doing in my code, so I'm not sure where the problem is.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>Sub Send_Emails()
  Dim stSubject As Variant
  Dim emailList As Variant
  Dim obSess As Object
  Dim obDB As Object
  Dim obDoc As Object
  
  '----Create Email List - separate function, dynamically creates email list based off report processing done in other functions
  CreateEmailList
  
  '----Info for Subject
  stSubject = "test subject"
  
  '----Create Notes Session
  Set obSess = CreateObject("Notes.NotesSession")
  Set obDB = obSess.GETDATABASE("", "")
  If obDB.IsOpen = False Then
     Call obDB.OPENMAIL
  End If
  
  '----Create the e-mail - **FAILURE OCCURS HERE** 
  Set obDoc = obDB.CreateDocument
  
  '----Add values to the email
  With obDoc
    .form = "Memo"
    .SendTo = "test@test.com"
    .blindcopyTo = emailList
    .Subject = stSubject
    .HTMLBody = "&lt;HTML&gt;&lt;BODY&gt;&lt;p&gt;test&lt;/p&gt;&lt;/BODY&gt;&lt;/HTML&gt;"
    .SaveMessageOnSend = True
    .PostedDate = Now()
    .Send 0, emailList
  End With
  
  '----Clean Up
  Set obDoc = Nothing
  Set obDB = Nothing
  Set obSess = Nothing
  
  MsgBox "The e-mail has been sent successfully", vbInformation
  End Sub
  </code></pre>