?
Solved

Problem with Redemption Component

Posted on 2006-06-12
4
Medium Priority
?
504 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

765 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