Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   How can I get the active pst size mounted in outlook ? (http://www.outlookbanter.com/add-ins-outlook/56010-how-can-i-get-active.html)

KAKA September 2nd 07 12:04 PM

How can I get the active pst size mounted in outlook ?
 
Hi, I had a question. How can I get the active pst size mounted in outlook ?
Using vbscript or add-in. I tried to get the size , but there is no such
parameter. Thanks.

MON205 September 2nd 07 03:04 PM

How can I get the active pst size mounted in outlook ?
 
First get the storeID of the PST you want, then use the code in the link
below to get the path of the PST.
At this point I think that you can continue :)
http://www.outlookcode.com/codedetail.aspx?id=1434




"KAKA" wrote:

Hi, I had a question. How can I get the active pst size mounted in outlook ?
Using vbscript or add-in. I tried to get the size , but there is no such
parameter. Thanks.


KAKA September 3rd 07 08:06 AM

How can I get the active pst size mounted in outlook ?
 
Thanks for your reply.
May I have the sample code about how to get the storeID, cause I am a fresh
in outlook coding. Cause there are different PST names of different people,
may be the
storeID is different. So I wanna it be universal to get all the active PST
in user's outlook. Thanks.

"MON205" wrote:

First get the storeID of the PST you want, then use the code in the link
below to get the path of the PST.
At this point I think that you can continue :)
http://www.outlookcode.com/codedetail.aspx?id=1434




"KAKA" wrote:

Hi, I had a question. How can I get the active pst size mounted in outlook ?
Using vbscript or add-in. I tried to get the size , but there is no such
parameter. Thanks.


KAKA September 4th 07 06:54 AM

How can I get the active pst size mounted in outlook ?
 
Hi, MON205, could you please give me a farther guide ? I'm in emergency. And
anybody could answer my question ?

"KAKA" wrote:

Hi, I had a question. How can I get the active pst size mounted in outlook ?
Using vbscript or add-in. I tried to get the size , but there is no such
parameter. Thanks.


MON205 September 4th 07 07:42 AM

How can I get the active pst size mounted in outlook ?
 
In your add-in, you have the "Outlook::_Application", from this point, use
the sequence below:
Outlook::_NameSpacePtr pMapi = spApp-GetNamespace( _bstr_t( "MAPI" ) );
_FoldersPtr pFoldersCollection = pMapi-get_Folders( & pFoldersCollection );
MAPIFolderPtr pFolder = NULL;
BSTR bstrStoreID;
long lFoldersCount = pFoldersCollection-GetCount( );
pFolder = pFoldersCollection-GetFirst( );
// Loop for PST's
for( long lIndex = 0; lIndex lFoldersCount; lIndex++ )
{
pFolder-get_StoreID( & bstrStoreID );
pFolder = pFoldersCollection-GetNext( );

// Here you have the StoreID for this PST
// Use the code in the web site I sent you to get the PST file path from
// thisStoreID
// Now after you have the file path, let it be strPSTFilePath
// Call OpenFile, then GetFileSizeEx, and don't forget calling
CloseHandle()
// to close the file handle
}

.... I hope this helps you

"KAKA" wrote:

Hi, MON205, could you please give me a farther guide ? I'm in emergency. And
anybody could answer my question ?

"KAKA" wrote:

Hi, I had a question. How can I get the active pst size mounted in outlook ?
Using vbscript or add-in. I tried to get the size , but there is no such
parameter. Thanks.


KAKA September 4th 07 01:42 PM

How can I get the active pst size mounted in outlook ?
 
Hi MON205, thaks for your guiding. May I have your mail address for
communicating directly ?

"MON205" wrote:

In your add-in, you have the "Outlook::_Application", from this point, use
the sequence below:
Outlook::_NameSpacePtr pMapi = spApp-GetNamespace( _bstr_t( "MAPI" ) );
_FoldersPtr pFoldersCollection = pMapi-get_Folders( & pFoldersCollection );
MAPIFolderPtr pFolder = NULL;
BSTR bstrStoreID;
long lFoldersCount = pFoldersCollection-GetCount( );
pFolder = pFoldersCollection-GetFirst( );
// Loop for PST's
for( long lIndex = 0; lIndex lFoldersCount; lIndex++ )
{
pFolder-get_StoreID( & bstrStoreID );
pFolder = pFoldersCollection-GetNext( );

// Here you have the StoreID for this PST
// Use the code in the web site I sent you to get the PST file path from
// thisStoreID
// Now after you have the file path, let it be strPSTFilePath
// Call OpenFile, then GetFileSizeEx, and don't forget calling
CloseHandle()
// to close the file handle
}

... I hope this helps you

"KAKA" wrote:

Hi, MON205, could you please give me a farther guide ? I'm in emergency. And
anybody could answer my question ?

"KAKA" wrote:

Hi, I had a question. How can I get the active pst size mounted in outlook ?
Using vbscript or add-in. I tried to get the size , but there is no such
parameter. Thanks.


MON205 September 4th 07 02:34 PM

How can I get the active pst size mounted in outlook ?
 
Hi KAKA…
Don’t hesitate to post any question you want. This is a good forum to post
questions in it.
Ideas here are public to all, and this forum helps a lot of people in their
tasks. I’m not sure that I can respond faster if you contacted me directly.
Another thing, you can say that I’m beginner here. I’m asking questions just
like you. Here you can find professionals that may help you more than I can.
Just as I told you, post any question you want, and ask about any thing you
can’t understand. We are all here to share efforts and to support each other.



"KAKA" wrote:

Hi MON205, thaks for your guiding. May I have your mail address for
communicating directly ?

"MON205" wrote:

In your add-in, you have the "Outlook::_Application", from this point, use
the sequence below:
Outlook::_NameSpacePtr pMapi = spApp-GetNamespace( _bstr_t( "MAPI" ) );
_FoldersPtr pFoldersCollection = pMapi-get_Folders( & pFoldersCollection );
MAPIFolderPtr pFolder = NULL;
BSTR bstrStoreID;
long lFoldersCount = pFoldersCollection-GetCount( );
pFolder = pFoldersCollection-GetFirst( );
// Loop for PST's
for( long lIndex = 0; lIndex lFoldersCount; lIndex++ )
{
pFolder-get_StoreID( & bstrStoreID );
pFolder = pFoldersCollection-GetNext( );

// Here you have the StoreID for this PST
// Use the code in the web site I sent you to get the PST file path from
// thisStoreID
// Now after you have the file path, let it be strPSTFilePath
// Call OpenFile, then GetFileSizeEx, and don't forget calling
CloseHandle()
// to close the file handle
}

... I hope this helps you

"KAKA" wrote:

Hi, MON205, could you please give me a farther guide ? I'm in emergency. And
anybody could answer my question ?

"KAKA" wrote:

Hi, I had a question. How can I get the active pst size mounted in outlook ?
Using vbscript or add-in. I tried to get the size , but there is no such
parameter. Thanks.


KAKA September 5th 07 03:28 AM

How can I get the active pst size mounted in outlook ?
 
Hi MON205, thanks for your suggestion. I use the following code to get the
path, but the result of some PST path is invalid, some is valid, it
confuses me a lot. Cause I can get the name in the code without path.
-------
Sub getStores()
Dim objSession As MAPI.Session
Dim objInfoStoresColl As InfoStores
Dim objInfoStore As InfoStore
Dim infS As InfoStore
Dim objFSO As FileSystemObject
Dim objFile As File
Dim PSTSize As Long


Set objSession = CreateObject("MAPI.Session")
objSession.Logon showdialog:=False, newsession:=False

Set objInfoStoresColl = objSession.InfoStores
If objInfoStoresColl Is Nothing Then

MsgBox "Could not set InfoStores collection"
Exit Sub
End If

If 0 = objInfoStoresColl.Count Then
MsgBox "No InfoStores in the collection"
Exit Sub
End If

Dim thePath As String

For i = 1 To objInfoStoresColl.Count
Set objInfoStore = objInfoStoresColl(i)

Dim j As Integer, magicNumber As Integer
magicNumber = 107
thePath = ""
For j = magicNumber To Len(objInfoStore.ID) - 2 Step 2
thePath = thePath & Chr(CInt("&H" & Mid(objInfoStore.ID, j, 2)))

Next j

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(thePath)
PSTSize = objFile.Size / 1024
PSTSize = PSTSize / 1024
MsgBox "i= " & i & Chr(10) & _
"PST File Name= " & objInfoStoresColl(i).Name & Chr(10) & thePath
& Chr(10) & PSTSize & "MB"

Next i

Set objInfoStoresColl = Nothing
objSession.Logoff
End Sub




--------
"MON205" wrote:

Hi KAKA…
Don’t hesitate to post any question you want. This is a good forum to post
questions in it.
Ideas here are public to all, and this forum helps a lot of people in their
tasks. I’m not sure that I can respond faster if you contacted me directly.
Another thing, you can say that I’m beginner here. I’m asking questions just
like you. Here you can find professionals that may help you more than I can.
Just as I told you, post any question you want, and ask about any thing you
can’t understand. We are all here to share efforts and to support each other.



"KAKA" wrote:

Hi MON205, thaks for your guiding. May I have your mail address for
communicating directly ?

"MON205" wrote:

In your add-in, you have the "Outlook::_Application", from this point, use
the sequence below:
Outlook::_NameSpacePtr pMapi = spApp-GetNamespace( _bstr_t( "MAPI" ) );
_FoldersPtr pFoldersCollection = pMapi-get_Folders( & pFoldersCollection );
MAPIFolderPtr pFolder = NULL;
BSTR bstrStoreID;
long lFoldersCount = pFoldersCollection-GetCount( );
pFolder = pFoldersCollection-GetFirst( );
// Loop for PST's
for( long lIndex = 0; lIndex lFoldersCount; lIndex++ )
{
pFolder-get_StoreID( & bstrStoreID );
pFolder = pFoldersCollection-GetNext( );

// Here you have the StoreID for this PST
// Use the code in the web site I sent you to get the PST file path from
// thisStoreID
// Now after you have the file path, let it be strPSTFilePath
// Call OpenFile, then GetFileSizeEx, and don't forget calling
CloseHandle()
// to close the file handle
}

... I hope this helps you

"KAKA" wrote:

Hi, MON205, could you please give me a farther guide ? I'm in emergency. And
anybody could answer my question ?

"KAKA" wrote:

Hi, I had a question. How can I get the active pst size mounted in outlook ?
Using vbscript or add-in. I tried to get the size , but there is no such
parameter. Thanks.


MON205 September 5th 07 08:04 AM

How can I get the active pst size mounted in outlook ?
 
Do you mean that you successfully get paths forsome PSTs but others no?!!
Are they all in the same path?
I don't know if the path starts ALWAYS from the character 107 (or 108). Try
the same code in the article (search for the last "00000000"). If this
doesn't work, post the storeid of the PST that you have troubles with -if u
want-.

"KAKA" wrote:

Hi MON205, thanks for your suggestion. I use the following code to get the
path, but the result of some PST path is invalid, some is valid, it
confuses me a lot. Cause I can get the name in the code without path.
-------
Sub getStores()
Dim objSession As MAPI.Session
Dim objInfoStoresColl As InfoStores
Dim objInfoStore As InfoStore
Dim infS As InfoStore
Dim objFSO As FileSystemObject
Dim objFile As File
Dim PSTSize As Long


Set objSession = CreateObject("MAPI.Session")
objSession.Logon showdialog:=False, newsession:=False

Set objInfoStoresColl = objSession.InfoStores
If objInfoStoresColl Is Nothing Then

MsgBox "Could not set InfoStores collection"
Exit Sub
End If

If 0 = objInfoStoresColl.Count Then
MsgBox "No InfoStores in the collection"
Exit Sub
End If

Dim thePath As String

For i = 1 To objInfoStoresColl.Count
Set objInfoStore = objInfoStoresColl(i)

Dim j As Integer, magicNumber As Integer
magicNumber = 107
thePath = ""
For j = magicNumber To Len(objInfoStore.ID) - 2 Step 2
thePath = thePath & Chr(CInt("&H" & Mid(objInfoStore.ID, j, 2)))

Next j

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(thePath)
PSTSize = objFile.Size / 1024
PSTSize = PSTSize / 1024
MsgBox "i= " & i & Chr(10) & _
"PST File Name= " & objInfoStoresColl(i).Name & Chr(10) & thePath
& Chr(10) & PSTSize & "MB"

Next i

Set objInfoStoresColl = Nothing
objSession.Logoff
End Sub




--------
"MON205" wrote:

Hi KAKA…
Don’t hesitate to post any question you want. This is a good forum to post
questions in it.
Ideas here are public to all, and this forum helps a lot of people in their
tasks. I’m not sure that I can respond faster if you contacted me directly.
Another thing, you can say that I’m beginner here. I’m asking questions just
like you. Here you can find professionals that may help you more than I can.
Just as I told you, post any question you want, and ask about any thing you
can’t understand. We are all here to share efforts and to support each other.



"KAKA" wrote:

Hi MON205, thaks for your guiding. May I have your mail address for
communicating directly ?

"MON205" wrote:

In your add-in, you have the "Outlook::_Application", from this point, use
the sequence below:
Outlook::_NameSpacePtr pMapi = spApp-GetNamespace( _bstr_t( "MAPI" ) );
_FoldersPtr pFoldersCollection = pMapi-get_Folders( & pFoldersCollection );
MAPIFolderPtr pFolder = NULL;
BSTR bstrStoreID;
long lFoldersCount = pFoldersCollection-GetCount( );
pFolder = pFoldersCollection-GetFirst( );
// Loop for PST's
for( long lIndex = 0; lIndex lFoldersCount; lIndex++ )
{
pFolder-get_StoreID( & bstrStoreID );
pFolder = pFoldersCollection-GetNext( );

// Here you have the StoreID for this PST
// Use the code in the web site I sent you to get the PST file path from
// thisStoreID
// Now after you have the file path, let it be strPSTFilePath
// Call OpenFile, then GetFileSizeEx, and don't forget calling
CloseHandle()
// to close the file handle
}

... I hope this helps you

"KAKA" wrote:

Hi, MON205, could you please give me a farther guide ? I'm in emergency. And
anybody could answer my question ?

"KAKA" wrote:

Hi, I had a question. How can I get the active pst size mounted in outlook ?
Using vbscript or add-in. I tried to get the size , but there is no such
parameter. Thanks.



All times are GMT +1. The time now is 12:25 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-2006 OutlookBanter.com