Link to home
Start Free TrialLog in
Avatar of inviser
inviser

asked on

Problem with Redemption Component

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 --------------------
ASKER CERTIFIED SOLUTION
Avatar of simoncampbell
simoncampbell
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of inviser
inviser

ASKER

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 --------------------
on which line?
Avatar of inviser

ASKER

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