A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Error 0 with Redemption...huh?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 24th 07, 12:18 AM posted to microsoft.public.outlook.program_addins
Dewey
external usenet poster
 
Posts: 26
Default Error 0 with Redemption...huh?

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
")

.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
Ads
  #2  
Old October 24th 07, 12:52 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Error 0 with Redemption...huh?

Which line exactly returns an error?
What does RDOSession do? Why do you create that object?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Dewey" wrote in message
...
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
")

.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



  #3  
Old October 24th 07, 01:19 AM posted to microsoft.public.outlook.program_addins
Dewey
external usenet poster
 
Posts: 26
Default Error 0 with Redemption...huh?

That's the thing...I wasn't even sure which line is creating the error..
BUT...something you said helped me see what's happening:

There was no error. The email wasn't getting sent, however, so it made me
think there was. In reality, I was passing an incorrect argument to the
subroutine. The first If statement checked that input, and since it wasn't
the true case the If was looking for, it made execution jump the entire
block, and end at the error handler. Normally, the sub would've been exited
at the bottom of the If block, but since it was never entered, the error
routine was run sdtraight away, even with no error.

Thanks for your help. This actually helps me to trap another case that I
didn't account for originally. Sorry for the trouble.

-Josh

"Dmitry Streblechenko" wrote:

Which line exactly returns an error?
What does RDOSession do? Why do you create that object?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Dewey" wrote in message
...
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
")

.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




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redemption - multiple emails for cc - error: could not resolve ema SAm Outlook and VBA 2 August 27th 07 08:40 PM
Outlook Redemption problem: Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154. [email protected] Add-ins for Outlook 1 September 18th 06 10:44 AM
Outlook Redemption problem: Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154. [email protected] Outlook - Using Forms 1 September 18th 06 10:44 AM
Redemption+CBuilder: RDOSession.Logon MAPILogonEx-Error [email protected] Add-ins for Outlook 2 September 1st 06 09:32 AM
Redemption Christoph Add-ins for Outlook 5 March 6th 06 04:26 PM


All times are GMT +1. The time now is 08:30 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.