View Single Post
  #1  
Old November 29th 07, 11:17 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 5
Default Sender address!!

Hi

Here is a very simple function, that works not on WinXP Off2K System.
When i call the function approx. 5 times, VB crashs! When i deactivate
the Debug Line all is fine. So the problem is th access to the Sender
Object.
Have anybody ideas about the reason? I am using CD0 1.21

Function GetSenderData()
Dim session As MAPI.session
Dim messages As MAPI.messages
Dim inbox As MAPI.folder

Set session = CreateObject("MAPI.Session")
session.Logon NewSession:=False

Set inbox =
session.GetDefaultFolder(CdoDefaultFolderTypes.Cdo DefaultFolderInbox)

Debug.Print inbox.messages(1).Sender.Type ' Crash Line!

' session.Logoff
' Set session = Nothing
' Set messages = Nothing

End Function
Ads