A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Links and Linking
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

link Ms Outlook



 
 
Thread Tools Display Modes
  #1  
Old November 23rd, 2004, 03:23 AM
souris
external usenet poster
 
Posts: n/a
Default link Ms Outlook

Hi All,


Are there any way to link the number of emails received on particular
folder?

Thanks in advance for the information,


Inung


  #2  
Old November 23rd, 2004, 10:04 AM
Bill Manville
external usenet poster
 
Posts: n/a
Default

Souris wrote:
Are there any way to link the number of emails received on particular
folder?


You would need to write a Visual Basic procedure (macro) using
Automation to Outlook to get the information for you.

I guess it would go something like:

Function GetNumberOfItemsInFolder(FolderName As String)
Dim oOut As New Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oF As Outlook.MAPIFolder
Set oNS = oOut.GetNamespace("MAPI")
Set oF = oNS.Folders("Personal Folders").Folders(FolderName)
GetNumberOfItemsInFolder = oF.Items.Count
Set oNS = Nothing
Set oOut = Nothing
End Function

Then in a worksheet cell you could put
=GetNumberOfItemsInFolder("InBox")

If you want it updated at each recalculate then you would need to add
Application.Volatile
before the first Set line

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup

  #3  
Old November 24th, 2004, 04:54 AM
souris
external usenet poster
 
Posts: n/a
Default


"Bill Manville" wrote in message
...
Souris wrote:
Are there any way to link the number of emails received on particular
folder?


You would need to write a Visual Basic procedure (macro) using
Automation to Outlook to get the information for you.

I guess it would go something like:

Function GetNumberOfItemsInFolder(FolderName As String)
Dim oOut As New Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oF As Outlook.MAPIFolder
Set oNS = oOut.GetNamespace("MAPI")
Set oF = oNS.Folders("Personal Folders").Folders(FolderName)
GetNumberOfItemsInFolder = oF.Items.Count
Set oNS = Nothing
Set oOut = Nothing
End Function

Then in a worksheet cell you could put
=GetNumberOfItemsInFolder("InBox")

If you want it updated at each recalculate then you would need to add
Application.Volatile
before the first Set line

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup



Thanks for the information,

Inung


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bug? Outlook 2003 can't handle LDAP, but Outlook Express 6 could?? Thomas H General Discussion 7 August 6th, 2004 07:30 PM
Unsafe Attachments Ron Installation & Setup 2 June 9th, 2004 01:55 AM
Outlook error after moving from Outlook 2003 to Outlook 2002 Navin Installation & Setup 0 May 13th, 2004 01:51 PM
Email link to Outlook Express Dave Peterson Setting up and Configuration 0 May 6th, 2004 03:11 AM


All times are GMT +1. The time now is 01:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.