Hi,
I wrote the following codes to read messages. They work fine for Outlook
2002 but fails for 2003. My felling it may be a bug of Outlook 2003. Anybody
has experience on that? Thanks in advance
Dim oOutlook As Outlook.Applica tion
Dim oNS As Outlook.NameSpa ce
Dim oStores As Outlook.Folders
Dim oStore As Outlook.MAPIFol der
Dim oFolders As Outlook.Folders
Dim oFolder As Outlook.MAPIFol der
Dim oMsgs As Outlook.Items
oOutlook = New Outlook.Applica tion
oNS = oOutlook.Sessio n
oNS.Logon(ShowD ialog:=False, NewSession:=Fal se)
oStores = oNS.Folders
oStore = oNS.Folders.Get First()
oFolders = oStore.Folders
oFolder = oFolders.Item(" Inbox")
oMsgs = oFolder.Items
Try
' if message class is 'IPM.Note.SMIME ' failed at below line
Dim oMsg As Outlook.MailIte m = oMsgs.GetFirst ' only for 'IPM.Note' message
Dim oMsg As Object = oMsgs.GetFirst ' only for 'IPM.Note.SMIME ' message
Debug.WriteLine (oMsg.Subject)
Debug.WriteLine (oMsg.MessageCl ass)
Debug.WriteLine (oMsg.Class)
' if message class is 'IPM.Note.SMIME ' failed at below line
Debug.WriteLine (CStr(oMsg.Rece ivedTime))
Debug.WriteLine ("-----------------------")
Catch ex As Exception
Debug.WriteLine (ex.Message.ToS tring)
End Try
oNS.Logoff()