• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Getting Run time error -2147417851 (80010105)

Dear Friends,

I am getting the error stated in the thread line when I execute the code
Set MailDoc = Maildb.CREATEDOCUMENT

Request you to please help me in fixing the error. I have google'd for solutions but unable to fix the issue..

I am trying to send out an email from excel 2007 via lotus notes 9...

Below is the code which I am using right now..

Code:
Sub testMail()

Dim UserName As String
Dim MailDbName As String
Dim Recipient As Variant
Dim ccRecipient As Variant
Dim Attachment1 As String
Dim Maildb As Object
Dim MailDoc As Object
Dim Session As Object
Dim stSignature As String

' Open and locate current LOTUS NOTES User

Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = Session.GetDatabase("", MailDbName)

If Maildb.IsOpen = True Then
Else
Maildb.OPENMAIL
End If

' Create New Mail and Address Title Handlers
Set MailDoc = Maildb.CREATEDOCUMENT


MailDoc.Form = "Memo"

stSignature = Maildb.GetProfileDocument("CalendarProfile").GetItemValue("Signature")(0)

' Select range of e-mail addresses
Recipient = Array("pavans11@Welcome.com", "karthic7@Welcome.com")
MailDoc.SendTo = Recipient
MailDoc.Subject = "Test Mail"
MailDoc.Body = _
"Now is the time for all good initiatives in IBM History"

MailDoc.SaveMessageOnSend = True

MailDoc.PostedDate = Now()
On Error GoTo errorhandler1
MailDoc.SEND 0, Recipient

errorhandler1:

Set Maildb = Nothing
Set MailDoc = Nothing
Set Session = Nothing

End Sub

Regards,
Pavan S
 
Back
Top