473,800 Members | 2,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Outlook inbox count from automation

I have the following code.
Dim Olapp As Object
Dim Olmapi As Object
Dim Olfolder As Object

Set Olapp = GetObject(, "Outlook.Applic ation") 'get reference
Set Olmapi = Olapp.GetNamesp ace("MAPI")
Set Olfolder = Olmapi.GetDefau ltFolder(6) '6 for olfolderinbox

MsgBox Olfolder.name & " " & Olfolder.Items. Count

The folder name is Inbox and the count is 80. I can't figure out where
it gets the number 80.

In the pane Mail/Favorite Folders I have
Inbox 30
Unread 30
Sent 8
Deleted 6

In the pain PersonalFolders I have
Drafts 18
Inbox 30
Junk 51
DeletedItems 6
Sent 8

Under ArchiveFolders I have
DeletedItems 29
SentItems 5

DeletedItems (29) = Junk (51) equals 80

Do you have any idea what is being tallied?

Apr 3 '07 #1
2 5916
On Tue, 03 Apr 2007 17:52:42 GMT, salad <oi*@vinegar.co mwrote:

Iterate over the collection and spit out some pertinent information.
But yes, I am surprised as well.
-Tom.

>I have the following code.
Dim Olapp As Object
Dim Olmapi As Object
Dim Olfolder As Object

Set Olapp = GetObject(, "Outlook.Applic ation") 'get reference
Set Olmapi = Olapp.GetNamesp ace("MAPI")
Set Olfolder = Olmapi.GetDefau ltFolder(6) '6 for olfolderinbox

MsgBox Olfolder.name & " " & Olfolder.Items. Count

The folder name is Inbox and the count is 80. I can't figure out where
it gets the number 80.

In the pane Mail/Favorite Folders I have
Inbox 30
Unread 30
Sent 8
Deleted 6

In the pain PersonalFolders I have
Drafts 18
Inbox 30
Junk 51
DeletedItems 6
Sent 8

Under ArchiveFolders I have
DeletedItems 29
SentItems 5

DeletedItems (29) = Junk (51) equals 80

Do you have any idea what is being tallied?
Apr 4 '07 #2
Tom van Stiphout wrote:
On Tue, 03 Apr 2007 17:52:42 GMT, salad <oi*@vinegar.co mwrote:

Iterate over the collection and spit out some pertinent information.
But yes, I am surprised as well.
-Tom.
Hi Tom:

My mind is made of mush. Low grey matter count. Doctors to give me
injection to get the count up past 1 later today.

The counter for inbox said 30. Unread said 30. So I went into inbox
and arrowed downwards past Today, Yesterday, last month, wayback and the
counter kept going down to 0 as each message was "viewed" and now there
is no counter and the item count for the entire inbox was 80 by my
count. DOH! I guess I thought those Yesterday, last months etc were
sub folders of the inbox and my assumptions were wrong.
>
>>I have the following code.
Dim Olapp As Object
Dim Olmapi As Object
Dim Olfolder As Object

Set Olapp = GetObject(, "Outlook.Applic ation") 'get reference
Set Olmapi = Olapp.GetNamesp ace("MAPI")
Set Olfolder = Olmapi.GetDefau ltFolder(6) '6 for olfolderinbox

MsgBox Olfolder.name & " " & Olfolder.Items. Count

The folder name is Inbox and the count is 80. I can't figure out where
it gets the number 80.

In the pane Mail/Favorite Folders I have
Inbox 30
Unread 30
Sent 8
Deleted 6

In the pain PersonalFolders I have
Drafts 18
Inbox 30
Junk 51
DeletedItems 6
Sent 8

Under ArchiveFolders I have
DeletedItems 29
SentItems 5

DeletedItem s (29) = Junk (51) equals 80

Do you have any idea what is being tallied?

Apr 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1822
by: Dave | last post by:
I want to be able to check my inbox in outlook for an email with a certain phrase in the 'subject' and then when found open and save the attachment to my c: drive. Can anyone help me with the VB required in MS Access 2000 to do this Thanks in advance Dave
1
8229
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 Access to import l;oop though my inbox and pick up all the usesr defined field data from any messages froma specific subject. I have have mixed and matched some code I found on the net however it doesn't seem to work properly. problems I face are:
2
2668
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 manually). If Outlook is not previously opened, I'm not sure if they are getting put into the Inbox folder or are being actually sent and then get received by me email server and sent down to me (I just see them appear in the inbox - but not...
0
2427
by: Joseph Kormann | last post by:
I'm trying to tie my application into the local running Outlook application through the Interop.Outlook.DLL. I'm looking for new / unread messages in the Inbox. No problem getting into the Inbox, but there is a problem using the Outlook.Items.Restrict method. The returned ItemsClass shows 10 unread messages (correct), but cycling through the list only shows me 6 of them. When I run it again, I get 4 unread messages (correct), but going...
7
6811
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 Inbox As Outlook.MAPIFolder Dim InboxItems As Outlook.Items Dim Mailobject As Object Set OlApp = CreateObject("Outlook.Application")
1
3226
by: =?Utf-8?B?cm9i?= | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox and server (Exchange server mail box) to connect and then save the mailitems(from Inbox or any other folder) based on a filter to a*.msg file. I want to achieve this using only one Interop dll if this is possible. Tried so far:
1
2872
by: allbelonging | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox and server (Exchange server mail box) to connect and then save the mailitems(from Inbox or any other folder) based on a filter to a*.msg file. I want to achieve this using only one Interop dll if this is possible. Tried so far:
0
1411
by: Mike P | last post by:
I have a collection of objects (oItems) that I want to use to populate a dataset. Basically I want to take several elements from oItems (such as SenderName, Subject and Body) and use them to populate separate columns of a dataset, and then use the dataset to populate a gridview. Can anybody help me out with this? //Create Outlook application Outlook.Application oApp = new Outlook.Application();
0
1058
by: Mike P | last post by:
I have a collection of objects (oItems) that I want to use to populate a dataset. Basically I want to take several elements from oItems (such as SenderName, Subject and Body) and use them to populate separate columns of a dataset, and then use the dataset to populate a gridview. Can anybody help me out with this? //Create Outlook application Outlook.Application oApp = new Outlook.Application();
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.