D
Dewey
Hi
I have a COM add-in I've been developing for a while that was working
great...up until I changed some things and lost track of all the changes.
Unfortunately, I'm not using version control, and I don't remember all of the
things I did. I'm not getting any compiler errors, but when I go to send an
email with the add-in, which uses Redemption in Outlook, I get an error with
a code of 0, trapped by the error handler in my code. What is an error with
a code of 0? Doesn't that mean "no error?" For some reason, there's a
problem there, but I'm not sure why.
The only other odd thing is that I have an "Imports MSMAPI" statement at
the top of my code that the compiler reports is now now able to be
found...I'm not sure if the two issues are related though.
Here's my code. Thanks for any help!:
Public Sub SendMail(ByVal mode As String)
'create a redemption session and log on
Dim Session As Redemption.RDOSession
Session = CreateObject("Redemption.RDOSession")
Session.Logon()
Dim omsg1 As Outlook.MailItem
Dim msg1 As New Redemption.SafeMailItem
'Create the object needed for the message:
omsg1 = m_olApp.CreateItem(OlItemType.olMailItem)
omsg1.BodyFormat = OlBodyFormat.olFormatHTML
omsg1.HTMLBody = pre_boarding1_body_html
omsg1.Subject = "Welcome!"
'Assign the message's soul to Redemption
msg1.Item = omsg1
With msg1
.Recipients.Add("(e-mail address removed)")
.Send()
msg1 = Nothing
omsg1 = Nothing
End With
'If CDate(txtStartDate.Text) > Now Then
m_olMailItem.DeferredDeliveryTime = CDate(txtStartDate.Text)
Return
Mailing_Error:
MsgBox("Error " & Err.Number & " while sending mail" & vbCrLf &
Err.Source)
End Sub
I have a COM add-in I've been developing for a while that was working
great...up until I changed some things and lost track of all the changes.
Unfortunately, I'm not using version control, and I don't remember all of the
things I did. I'm not getting any compiler errors, but when I go to send an
email with the add-in, which uses Redemption in Outlook, I get an error with
a code of 0, trapped by the error handler in my code. What is an error with
a code of 0? Doesn't that mean "no error?" For some reason, there's a
problem there, but I'm not sure why.
The only other odd thing is that I have an "Imports MSMAPI" statement at
the top of my code that the compiler reports is now now able to be
found...I'm not sure if the two issues are related though.
Here's my code. Thanks for any help!:
Public Sub SendMail(ByVal mode As String)
'create a redemption session and log on
Dim Session As Redemption.RDOSession
Session = CreateObject("Redemption.RDOSession")
Session.Logon()
Dim omsg1 As Outlook.MailItem
Dim msg1 As New Redemption.SafeMailItem
'Create the object needed for the message:
omsg1 = m_olApp.CreateItem(OlItemType.olMailItem)
omsg1.BodyFormat = OlBodyFormat.olFormatHTML
omsg1.HTMLBody = pre_boarding1_body_html
omsg1.Subject = "Welcome!"
'Assign the message's soul to Redemption
msg1.Item = omsg1
With msg1
.Recipients.Add("(e-mail address removed)")
.Send()
msg1 = Nothing
omsg1 = Nothing
End With
'If CDate(txtStartDate.Text) > Now Then
m_olMailItem.DeferredDeliveryTime = CDate(txtStartDate.Text)
Return
Mailing_Error:
MsgBox("Error " & Err.Number & " while sending mail" & vbCrLf &
Err.Source)
End Sub