I have a vs 2003 c# program that extracts dist lists how do i change it to vs 2005 c#

L

lewie

Option Explicit On
Imports System.IO
Imports System.Web.Mail
Imports System.Configuration


Module Module1
' This constant is not included in the CDO (1.x) type library,
' so you must declare it explicitly or use the provided
' value directly.
Private Const CdoPR_EMS_AB_PROXY_ADDRESSES = &H800F101E
Private Const Delimiter = ";"
Sub Main()
Dim objSession As MAPI.Session
Dim objAddressLists As MAPI.AddressLists
Dim objField As MAPI.Field
On Error GoTo ET1
' Create Session object and Logon.
objSession = CreateObject("MAPI.Session")
'objSession.Logon()
objSession.Logon("lewis.k", "", False, True )
objAddressLists = objSession.AddressLists
Dim objGal As MAPI.AddressList = objAddressLists.Item("Global
Address List")
Dim nextlist As String
Dim distributions As New Hashtable
Dim addressess As New DataTable
Dim colName As New DataColumn
colName.ColumnName = "Name"
colName.DataType = System.Type.GetType("System.String")
colName.AllowDBNull = False
colName.Caption = "Name"
addressess.Columns.Add(colName)
Dim colEmail As New DataColumn
colEmail.ColumnName = "Email"
colEmail.DataType = System.Type.GetType("System.String")
colEmail.AllowDBNull = False
colEmail.Caption = "Email"
addressess.Columns.Add(colEmail)
' TO DO Loop through input file
Dim objReader As StreamReader = New
StreamReader(ConfigurationSettings.AppSettings("WorkingPath") +
"\Input\" + "Input1.txt")
nextlist = objReader.ReadLine
While nextlist > ""
Recurse(objGal, addressess, distributions, nextlist)
Dim file_name As String =
ConfigurationSettings.AppSettings("WorkingPath") + "\Output\" +
nextlist
Dim stream_writer As New IO.StreamWriter(file_name, False)
addressess.DefaultView.Sort = "Name"
stream_writer.WriteLine("this file has " +
Str(addressess.Rows.Count) + " rows")
For Each dr As System.Data.DataRowView In
addressess.DefaultView
stream_writer.Write(dr("Name"))
stream_writer.Write(

this is the declaration part
Thanks
Lewie
 
L

lewie

I rolled it back to vs 2003 and used outlook 2003 and xp and it is
failing login. Can anyone point me to any articles on why it would now
fail logon.
Thanks again.
Lewie
 
G

gxdata

One suggestion is to first of all manually logon to Outlook 2003, then
change the line -
objSession.Logon("lewis.k", "", False, True )
to
objSession.Logon("", "", True, True )

and you should get automatic logon.
(but XP SP2 and patches to Outlook 2003 mean that you may also get a
security warning at some time, asking if you want to allow access for 1,2,5
minutes or whatever).
 
Top