com >> Outlook Connection

by RW1yZSBTYW1pIFPDnFpFUg » Fri, 26 May 2006 20:18:02 GMT

I am developing a VB.NET application that works synchronized with Outlook
Contacts, but at some certain records that I don't know I get an:

"An unhandled exception of type 'System.InvalidCastException' occurred in
..."

error when calling:

"objOutlookContactItem = objOutlookItems.GetNext"

The code that I am using is:

objOutlookItems = objOutlookFolder.Items
objOutlookContactItem = objOutlookItems.GetFirst
For j = 0 To objOutlookItems.Count - 1
System.Windows.Forms.Application.DoEvents()
If Not IsDBNull(objOutlookContactItem.Email1Address) Then
If Len(objOutlookContactItem.Email1Address) > 0 Then

chklstEpostalar.Items.Add(objOutlookContactItem.Email1Address)
End If
End If
lblToplam.Text = CStr(CLng(lblToplam.Text) + 1)
objOutlookContactItem = objOutlookItems.GetNext

Next

I don't get an error all records. For example on the 249th record I get it..
Is there any suggestions?




com >> Outlook Connection

by Jan Hyde » Fri, 26 May 2006 21:53:14 GMT


Emre Sami SER < XXXX@XXXXX.COM >'s
wild thoughts were released on Fri, 26 May 2006 05:18:02
-0700 bearing the following fruit:


Then you'll need to ask your question in a dotnet group.

This one if for VB6 (and below)

j



Jan Hyde (VB MVP)

--
Psalm: Less than many but more than none (Brandi Brandon)




Similar Threads

1. WINS/Outlook connection problem

2. Outlook connection problem to Exchange

Hello NG,

i have the follwing problem.

If i add a new profile in outlook and entered the exchange name + mailbox, 
it can be found.
If i change the name from the exchange server to an ad server, it works.

Exchange Version 2007

Last night, we must restart the MSExchangeSA Service, i think this could be 
the problem.

Any idea ?

regards

Philipp 


3. Automating mass Outlook connection to Exchange - Manage MS Exchange Server

4. Outlook connection to Exchange 2003

Hello,

I have 1 user in the company who has 2 times the mailbox in outlook 
regardless that the profile is created as always.... both with the same 
data.

This user also experience a long waiting time to sync his mailbox to the ost 
file.

We tryed deleting the profile and creating it again but after some minutes 
the 2nd copy of the mailbox apear.

We have migrated from Exchange 2000 2 weeks ago. Before the migration this 
was not happening.

Thanks in advance for any clue

Daniel.- 


5. GFI MailArchiver Outlook Connection - Manage MS Exchange Server

6. Outlook connection error

Outlook 2002
SBS 2003 SP2
I am trying to configure outlook with exchange. When I enter all the details 
I can brows the user (ie I get a connection to the server) but when I start 
outlook I get the error connection cannot be made.

Any ideas where I am going wrong.

Outlook works fine internaly, OWA works ok.

Cheers

SteveW 


7. Outlook Connection Status... - Manage MS Exchange Server

8. Outlook Connection to Exchange Server Hangs Up

Outlook 2003 Professional.  Exchange Server 2003.

I have an Outlook client who connects to our exchange server over the 
internet using "RPC over HTTP" to make the connection.  Below is a 
description of his problem, a problem I have had reported by others with the 
same configuration.  What might be causing this?

Microsoft Outlook I connect and it sends and downloads.  Then, after a 
minute or so, I see a red exclamation point in a yellow diamond in the 
Outlook icon which is at the bottom right of my screen where all the programs 
that are running show.  When I put the mouse over the symbol a message saying 
icrosoft Office Outlook is requesting data from the serverpops up.  It 
stays up from then on and if I quit the program the Outlook window closes but 
it doesn really quit.  I can go into the Windows Task Manager under the 
rocessestab and it shows Outlook as still running.  I know this is true 
because if I start Outlook again it doesn ask me for the password for the 
server; it just opens up the Outlook window.  It isn able to connect to the 
server.  However, if I nd Processin the Task Manager and quit Outlook 
that way, when I start it again, it asks me for the network password.  Then 
it connects, downloads, sends, and I get the same symbol saying it is 
requesting data.  This cycle repeats itself every time I want to send an 
email.

Also, it hasn fully synced the Sent Message folder because it hasn ever 
kept the data window open long enough to finish that process.

-- 
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org