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.MAPIOB JECT() resides in.
'Session' is not a member of 'System.Windows.Forms.Appl ication'.
-------------------- Begin Code --------------------
Dim objSession
Dim Account, Accounts
objSession = CreateObject("Redemption.R DOSession" )
objSession.MAPIOBJECT = Application.Session.MAPIOB JECT()
-------------------- End Code --------------------
'Session' is not a member of 'System.Windows.Forms.Appl
-------------------- Begin Code --------------------
Dim objSession
Dim Account, Accounts
objSession = CreateObject("Redemption.R
objSession.MAPIOBJECT = Application.Session.MAPIOB
-------------------- End Code --------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
on which line?
ASKER
I figured it out, here's the code:
-------------------- Begin Code --------------------
Imports Microsoft.Office.Interop.O utlook
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.O utlook.App lication = New Microsoft.Office.Interop.O utlook.App lication()
objSession = CreateObject("Redemption.R DOSession" )
objSession.MAPIOBJECT = OutlookApp.Session.MAPIOBJ ECT()
Accounts = objSession.Accounts
End Sub
End Class
-------------------- End Code --------------------
-------------------- Begin Code --------------------
Imports Microsoft.Office.Interop.O
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.O
objSession = CreateObject("Redemption.R
objSession.MAPIOBJECT = OutlookApp.Session.MAPIOBJ
Accounts = objSession.Accounts
End Sub
End Class
-------------------- End Code --------------------
ASKER
Error: Reference to a non-shared member requires an object reference.
-------------------- Begin Code --------------------
Imports Microsoft.Office.Interop.O
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.R
objSession.MAPIOBJECT = Application.Session.MAPIOB
Accounts = objSession.Accounts
For Each Account In Accounts
Debug.Print(Account.Name)
Next
End Sub
End Class
-------------------- End Code --------------------