Solved

Problem with Redemption Component

Posted on 2006-06-12
4
478 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with Syntax 9 36
VB.Net Tranfer data between to VB.Net apps 8 25
Calculate number of nights between two dates 5 20
location of a form 2 11
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

776 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