A Microsoft Outlook email forum. Outlook Banter

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 » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

view folder size in outlook using a macro



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 4th 06, 05:07 PM posted to microsoft.public.outlook.program_vba
john mcmichael
external usenet poster
 
Posts: 3
Default view folder size in outlook using a macro

I'm trying to set up a macro that when run, allows me to see the size of all
folders in Outlook. I am using the set of code below but I can not get it to
work. I open the VBE and have the code exactly how it is shown below. Is
there something that I have missed. I would also like to have a popup box
with management recomenedations appear in the box. Is this possible? I have
next to no VBA experience and that is by biggest problem...so speak
slowly...I'm afraid I might not understand. Sorry to keep bothering people
with this, but if I can get it to fly, this will be very helpful.

Private Sub GetFolderSizes()
Dim objOutlook As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder, objUnknown As Object
Dim lngBytes As Long, intX As Integer


Set objOutlook = New Outlook.Application
Set objNS = objOutlook.GetNamespace("MAPI")
Set objFolder = objNS.GetDefaultFolder(olFolderInbox)


For intX = 1 To objFolder.Items.Count
lngBytes = lngBytes + objFolder.Items.Item(intX).Size
Next


MsgBox "Folder size is " & lngBytes & " bytes."
End Sub


Thanks
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change outlook 2003 notes to a sub folder view Jeffk3 Outlook - Using Contacts 1 May 4th 06 08:16 AM
create macro to show file size in outlook john mcmichael Outlook and VBA 3 May 2nd 06 10:55 PM
Display size on Detailed Address View Shayna Punim Outlook - Using Contacts 1 May 1st 06 01:07 AM
OE folder size limitation? Bill H. Outlook Express 2 February 23rd 06 07:52 AM
View free/busy not consisten in folder/schedule view & Exclusive l Toàn Outlook - Calandaring 0 February 9th 06 03:20 PM


All times are GMT +1. The time now is 08:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.