How to retreiving IPM.Note.SMIME message through Outlook 2003

G

Guest

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.Application
Dim oNS As Outlook.NameSpace
Dim oStores As Outlook.Folders
Dim oStore As Outlook.MAPIFolder
Dim oFolders As Outlook.Folders
Dim oFolder As Outlook.MAPIFolder
Dim oMsgs As Outlook.Items

oOutlook = New Outlook.Application
oNS = oOutlook.Session
oNS.Logon(ShowDialog:=False, NewSession:=False)

oStores = oNS.Folders

oStore = oNS.Folders.GetFirst()
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.MailItem = 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.MessageClass)
Debug.WriteLine(oMsg.Class)
' if message class is 'IPM.Note.SMIME' failed at below line
Debug.WriteLine(CStr(oMsg.ReceivedTime))
Debug.WriteLine("-----------------------")
Catch ex As Exception
Debug.WriteLine(ex.Message.ToString)
End Try

oNS.Logoff()
 
J

Jay B. Harlow [MVP - Outlook]

Li,
I will check to see what I can find out.

In the mean time: Have you tried in one of the Outlook programming groups?
(this is after all a VB.NET newsgroups). One of the
microsoft.public.outlook.* newsgroups?

Have you tried http://www.outlookcode.com?

Hope this helps
Jay

| 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.Application
| Dim oNS As Outlook.NameSpace
| Dim oStores As Outlook.Folders
| Dim oStore As Outlook.MAPIFolder
| Dim oFolders As Outlook.Folders
| Dim oFolder As Outlook.MAPIFolder
| Dim oMsgs As Outlook.Items
|
| oOutlook = New Outlook.Application
| oNS = oOutlook.Session
| oNS.Logon(ShowDialog:=False, NewSession:=False)
|
| oStores = oNS.Folders
|
| oStore = oNS.Folders.GetFirst()
| 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.MailItem = 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.MessageClass)
| Debug.WriteLine(oMsg.Class)
| ' if message class is 'IPM.Note.SMIME' failed at below line
| Debug.WriteLine(CStr(oMsg.ReceivedTime))
| Debug.WriteLine("-----------------------")
| Catch ex As Exception
| Debug.WriteLine(ex.Message.ToString)
| End Try
|
| oNS.Logoff()
|
|
 
G

Guest

Jay,

Any results on this issue. I found some similar requests in the Web but
without the solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top