473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

.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 1187
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: KS | last post by:
Hi, I have creatd a custom Outlook form with a few custom form fields. When completed the form is sent to me and goes into my Inbox. This works fine. Now Iam trying to write some code in...
2
by: Susan Bricker | last post by:
I have a routine that uses Late Binding to create a email and put it into the DRAFTS folder of Outlook. It only works if Outlook is already launched (Opened by me clicking on my desktop ICON...
7
by: Chris Thunell | last post by:
I'm trying to loop through an exchange public folder contact list, get some information out of each item, and then put it into a vb.net datatable. I run though the code and all works fine until i...
3
by: Lars Netzel | last post by:
I need to know if I can look for "Inbox" or as in Swedish "Inkorgen"... or can one asume I that the Inbox has a special index if I loop thru the folders? /Lars Netzel
0
by: Sanjay | last post by:
ho to all i am using this code Dim OuApp = New Outlook.ApplicationClass() Dim NSpace As Outlook.NameSpace Dim Fldrs As Outlook.Folders Dim subFldr As Outlook.MAPIFolder
2
by: | last post by:
Hi All, I know that Microsoft Exchange has a com interface, CDO, but I can't seem to find one for Microsoft outlook. does anyone have code snippets for using msoutlook and python, or suggestions?...
7
by: Dean Spencer | last post by:
Can anyone help? I am importing Emails from Outlook using the following code: Public Function ScanInbox(SubjectLine As String) Dim TempRst As Recordset Dim OlApp As Outlook.Application Dim...
5
by: =?Utf-8?B?YW5rdQ==?= | last post by:
Hey folks, I have created two empty.pst files and it created two empty folders both named "Personal Folder". This is fine, but my problem is I have two .pst files, p1 and p2. I want to move...
2
by: bill | last post by:
I have this code to get to the default Outlook inbox but I would like to get to the inbox of an additional added mailbox. Can this be done? Here is the code I'm using below: Dim objSession As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.