Solved

Problem with Redemption Component

Posted on 2006-06-12
4
469 Views
Last Modified: 2008-01-09
Hopefully someone here is familiar with the redemption component that helps you interface with outlook. I am using vb.net 2005 and have added redemption.dll as a reference to my project. However I get this error with the code below. Any ideas? It seems to be self explanatory, but I see the code I have at the bottom all over the internet, but none of the example sites show what namespace Application.Session.MAPIOBJECT() resides in.

'Session' is not a member of 'System.Windows.Forms.Application'.      

-------------------- Begin Code --------------------

Dim objSession
Dim Account, Accounts
       
objSession = CreateObject("Redemption.RDOSession")
objSession.MAPIOBJECT = Application.Session.MAPIOBJECT()

-------------------- End Code --------------------
0
Comment
Question by:inviser
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
simoncampbell earned 500 total points
ID: 16895551
You need to add a reference to the Outlook namespace.
Right click your project and click 'add reference', then select Microsoft.Office.Interop.Outlook
0
 
LVL 6

Author Comment

by:inviser
ID: 16895949
Thanks for the help so far. I did as you said below and it seems to fix the previous error but now I get a new one and I'm not  sure what to do about it. Any ideas?

Error: Reference to a non-shared member requires an object reference.

-------------------- Begin Code --------------------

Imports Microsoft.Office.Interop.Outlook

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim objSession
        Dim Account, Accounts

        objSession = CreateObject("Redemption.RDOSession")
        objSession.MAPIOBJECT = Application.Session.MAPIOBJECT()
        Accounts = objSession.Accounts
        For Each Account In Accounts
            Debug.Print(Account.Name)
        Next
    End Sub
End Class

-------------------- End Code --------------------
0
 
LVL 6

Expert Comment

by:simoncampbell
ID: 16897284
on which line?
0
 
LVL 6

Author Comment

by:inviser
ID: 16897515
I figured it out, here's the code:

-------------------- Begin Code --------------------

Imports Microsoft.Office.Interop.Outlook

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim objSession
        Dim Account, Accounts
        Dim objAccount

        Dim OutlookApp As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application()

        objSession = CreateObject("Redemption.RDOSession")
        objSession.MAPIOBJECT = OutlookApp.Session.MAPIOBJECT()
        Accounts = objSession.Accounts
    End Sub
End Class

-------------------- End Code --------------------
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now