Solved

Problem with Redemption Component

Posted on 2006-06-12
4
497 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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