Page 1 of 1 1
Topic Options
#84999 - 2002-01-29 07:16 PM getting outlook message store size
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
while in Outlook, if you were to get the properties of the outlook mailbox, select Folder Size, it will return a window describing the total size used by the mailbox and the sizes of the subfolders.

Can someone COM this??

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#85000 - 2002-01-29 11:18 PM Re: getting outlook message store size
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
now I am nowhere near to being a programmer, and I am on very shaky ground here, trying to do this COM stuff.

This is the closest I have come to getting this to work... I can get the number of messages in the inbox, is that worth anything?

$OL = CreateObject("outlook.Application")
$mapi=$ol.getnamespace("mapi")
? $mapi

$inbox=$mapi.getdefaultfolder(6)
? $inbox

$count=$inbox.items.count
? $count

$first=$inbox.items(1).subject
? $first

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#85001 - 2002-01-29 11:26 PM Re: getting outlook message store size
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Rad,

I have been doing some digging in the Exchange properties and found the following cool app to get the properties you are looking for. It also comes a with a VB Reference on this as well.

Check it out!

Outlook Spy

Talk to you later!

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#85002 - 2002-01-29 11:49 PM Re: getting outlook message store size
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
since exchange is a type of LDAP server.... you might be able to get to this informaion through the LDAP interface.

Bryce

Top
#85003 - 2002-01-30 01:48 AM Re: getting outlook message store size
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Rad,

This is untested. But, this should give you a rough idea.

code:

; -- Pieces stolen from - http://cwashington.netreach.net/depo/view.asp?Index=445&ScriptType=vbscript
; -- You will need to have CDO.DLL installed too..

BREAK ON CLS

Dim CdoPR_ACCOUNT

CdoPR_CONTAINER_CLASS = &H3613001E


$OL = CreateObject("outlook.Application")
$mapi=$ol.getnamespace("mapi")
? $mapi

$inbox=$mapi.getdefaultfolder(6)
? $inbox

$count=$inbox.items.count
? $count

$size=$inbox.object.Size
? $size

$first=$inbox.items(1).subject
? $first

$intCounter = 1
; Loop through the infostores
For $intCounter = 1 To $mapi.InfoStores.Count

;' Check if we have not hit the public information store
If Trim(UCase($mapi.Infostores.Item($intCounter).Name)) <> "PUBLIC FOLDERS" Then

;Get the root folder
$objRootFolder = $mapi.Infostores.Item($intCounter).RootFolder
;Get the folder collection
$objFoldersColl = $objRootFolder.Folders ;Folders collection
;Wscript.Echo objFoldersColl.count
If $objFoldersColl <> "" Then
; get the first folder in the collection
$objOneFolder = $objFoldersColl.GetFirst

?$objOneFolder.name
;loop through all the folders in the collection
Do While $objOneFolder <> ""

; Check all messages in this folder
; is it a Mail Item folder?
$objFields = $objOneFolder.Fields
$strFolderType = $objFields.Item(CdoPR_CONTAINER_CLASS)
If $strFolderType = "IPF.Note" Then
$objFields = ""
;check all subfolders also
$size=$inbox.object.Size ; -- Get the current folder size
$fldrsize = $size ; -- Set it to a computed global variable
$ttlsize = $size+$ttlsize
? $size+" of Folder"
? $ttlsize+" Total"

EndIf
$objOneFolder = $objFoldersColl.GetNext
Loop
EndIf

; Add the results to the report text
;? strUserName
EndIf
Next


Have fun!

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#85004 - 2002-02-10 03:26 AM Re: getting outlook message store size
Bonji Offline
Starting to like KiXtart

Registered: 2001-09-28
Posts: 169
Loc: Virginia
My most frustrating experience with COM is finding the properties that an application has available to use. Is there a way to get a dump of all such properties from an App? For example: How do you know all the COM hooks into Outlook? They (generally speaking) are not very intuitive and I can find no reference to list them for any application. Thanks for any help.

[ 10 February 2002: Message edited by: Ben Dulaney ]

Top
#85005 - 2002-02-10 03:40 AM Re: getting outlook message store size
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
No need to explain futher ... i share your pain ... ummm, here's a quick and dirty if you office 2000 installed (and depending on the "app" your looking for) ...

1) Start Excel

2) Go TOOLS->REFERENCES

3) Select "Windows Script Host Object Model"

4) Click OK

5) Go VIEW->OBJECT BROWSER

6) Drop down "All Libraries" and select "IWshRuntimeLibrary" instead

7) Select "WshShortcut" in Classes

And on the right is all the methods and properties. Method are documented in the bottom window - with all the required parameters and their types ... some interface definitions even have good descriptions of what the function does and some help ...

Not sure if Outlook will show up as a reference for you or not ... But I hope this helps a little ...

-Shawn

[ 10 February 2002: Message edited by: Shawn ]

Top
#85006 - 2002-02-10 03:52 AM Re: getting outlook message store size
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
oops sorry - missed a step ...

1.5) Go TOOLS->MACRO->VISUAL BASIC EDITOR

-Shawn

Top
#85007 - 2002-02-10 04:07 AM Re: getting outlook message store size
Bonji Offline
Starting to like KiXtart

Registered: 2001-09-28
Posts: 169
Loc: Virginia
Thanks Shawn. I figured out that first step was missing . I found lots of good stuff there including lots of Office info. I'm trying to work with IE at the moment and it was much more limited compared to some of the other references. Is this pretty much it as far as discovering what I can use to manipulate a program with(i.e. IE )? Thanks for your help, it's very much appreciated.
Top
#85008 - 2002-02-10 05:26 AM Re: getting outlook message store size
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
There's another tool called OLEVIEW.EXE that ships with Visual Studio, but it basically gives you the RAW view of what your seeing with the Visual Basic Editor ... they both read the same COM typelibs but VBA at least gives you a nicer interface and easier navigation ...

Internet Explorer you say, eh ?

OK, here a small "teach a man to fish" kinda tutorial on performing your own COM discovery ...

The only peice of information you have is the "ProgID" and for internet explorer, we know that is "internetexplorer.application". So go into regedit.exe and do the following initial steps:

1) Start regedit

2) Open HKEY_CLASSES_ROOT

3) Find InternetExplorer.Application

4) Open up that key and click CLSID

5) Should say default="{0002DF01-0000-0000-C000-000000000046}"

6) Double-click "default" and ^C the CLSID into your clipboard buffer

7) Go all the way back up to the top of HKEY_CLASSES_ROOT again.

8) Find a key called HKEY_CLASSES_ROOT\CLSID

9) Crack it open and hit ^F (find) then ^V the CLSID into the dialogbox and press "Find Next"

10) Crack it open and check out "LocalServer32" (for DLL's, the key is called InprocServer32") Internet Explorer is a .exe localserver. But we're here to check out a key called "TypeLib" - check out the default value of that.

11) The default data value should say "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}". This is the CLSID of the typelib that describes the interface in all it's gory details ... select this value into your clipboard buffer. We're not done yet.

12) In HKEY_CLASSES_ROOT\CLSID search for this typelib class id ... when you find it, you should see a new reference to an InProcServer32 now - the value is:

%SystemRoot%\System32\shdocvw.dll

Whew ... now you know that the COM typelib information for the component called InternetExplorer.Application is implemented inside a DLL (as a resource) at:

%SystemRoot%\System32\shdocvw.dll

This is part one of the adventure ... if you don't want to perform the previous steps, just take things from here ... now on to Part II ...

1) Start Excel and the Visual Basic Editor.

2) Go TOOLS->REFERENCES

3) Click BROWSE on the dialog

4) Paste %SystemRoot%\System32\shdocvw.dll into the filename box

5) Click "Open" and now you should have a new reference called "Microsoft Internet Controls"

6) Click OK and go VIEW->Object Browser

7) Select SHDocVW and you should see a class called "InternetExplorer" under classes. Select it.

8) Look in the right pane - look familiar ?

Hope this helps.

-Shawn

Top
#85009 - 2002-02-10 05:34 AM Re: getting outlook message store size
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Oh yeah, this is just the "application server" typelib. If you want to find out more about the "Document" object methods and properties, they are implemented inside this file:

F:\WINNT\System32\MSHTML.TLB

So select that as a reference. Once you do that, find a class called "HTMLDocument" and you might see familiar methods like

write
writeln
readystate
getelementbyid

you name it - it's there.

-Shawn

[ 10 February 2002: Message edited by: Shawn ]

Top
#85010 - 2002-02-10 06:17 AM Re: getting outlook message store size
Bonji Offline
Starting to like KiXtart

Registered: 2001-09-28
Posts: 169
Loc: Virginia
Impressive as usual. This is great, I'll be KiX'n IE in no time now. Once again I thank you for your input.
Top
#85011 - 2002-02-10 06:39 AM Re: getting outlook message store size
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
no probs, and here's an msdn link you might want to bookmark:

DHTML Reference

-Shawn

Top
#85012 - 2002-02-11 04:17 AM Re: getting outlook message store size
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Hi,

I use a program called TLBDOC, it is a Type Library documenter that creates a .HLP file (need to install MS's help workshop) from a .DLL file telling you all the properties, methods and functions and their parameters.

Here is a copy and paste of the FolderExists function from SCRRUN.DLL (aka Windows Scripting Host)

[u]See also[/u]


Declaration: FolderExists(FolderSpec as String) as Boolean


Return Value


Description
Check if a path exists


You can get TLBDOC from CodeStone Software


cj

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2312 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.116 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org