468,537 Members | 1,954 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,537 developers. It's quick & easy.

.Net Outlook Inbox Folder Question Getting 1st Message problem.

All,

I have some code that is executed when a "New E-mail" arrives. When
executing this code on several different machines I get either the New
Message or the Last Message. All machines are running same version of
Outlook 2003 SP1.

On one machine Visual Studio .Net is installed. On this machine I get the
last message when issuing the
molMi = molmfib.Items(1) instead of the New Message.

On the other machine I get the "New Message"...

Any explainationtions?

Here is what I am using to get the mail...

Dim molns As Outlook.NameSpace
Dim molmfib As Outlook.MAPIFolder
Dim molMi As Outlook.MailItem
Dim i As Integer
molns = m_Olapp.GetNamespace("MAPI")
molmfib =
molns.GetDefaultFolder(Outlook.OlDefaultFolders.ol FolderInbox)

Visual Studio .Net PC
i = molmfib.Items.Count
molMi = molmfib.Items(i)
sSubTemp = molMi.Subject

'Other Machine Code to get New Message
molMi = molmfib.Items(1)

Thanks,

Rog
Nov 21 '05 #1
1 1073
Hi Roger,

The problem could be how the messages are sorted in each Outlook. One
probably puts new messages at the top while the other puts them at the
bottom. I think you would need to loop through them and pull them off based
on date or on the property that shows whether or not they were already read.
I've never worked with Outlook so I don't know what those properties are. A
quick look at the object model should tell you. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Roger" <da*****@netins.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
All,

I have some code that is executed when a "New E-mail" arrives. When
executing this code on several different machines I get either the New
Message or the Last Message. All machines are running same version of
Outlook 2003 SP1.

On one machine Visual Studio .Net is installed. On this machine I get the
last message when issuing the
molMi = molmfib.Items(1) instead of the New Message.

On the other machine I get the "New Message"...

Any explainationtions?

Here is what I am using to get the mail...

Dim molns As Outlook.NameSpace
Dim molmfib As Outlook.MAPIFolder
Dim molMi As Outlook.MailItem
Dim i As Integer
molns = m_Olapp.GetNamespace("MAPI")
molmfib =
molns.GetDefaultFolder(Outlook.OlDefaultFolders.ol FolderInbox)

Visual Studio .Net PC
i = molmfib.Items.Count
molMi = molmfib.Items(i)
sSubTemp = molMi.Subject

'Other Machine Code to get New Message
molMi = molmfib.Items(1)

Thanks,

Rog

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Susan Bricker | last post: by
3 posts views Thread by Lars Netzel | last post: by
reply views Thread by Sanjay | last post: by
7 posts views Thread by Dean Spencer | last post: by
5 posts views Thread by =?Utf-8?B?YW5rdQ==?= | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.