Link to home
Start Free TrialLog in
Avatar of verto33
verto33

asked on

Establish the folder size

Is there any possibility to find out how big each several folder is?

e.g. Inbox, Sent Items or other user created folder
Avatar of mbonaci
mbonaci
Flag of Croatia image

Hi verto33,
the first that comes to mind is to go through the view/folder doc by doc and summarize the sizes:

The size of a document in bytes:
    size = notesDocument.Size

Hope this helps,
Marko
verto33,
this is quicker solution from Qualitee:

https://www.experts-exchange.com/questions/21269312/how-to-see-folders-size.html

Hope this helps,
Marko
Avatar of Sjef Bosman
A folder has no size...
Avatar of verto33
verto33

ASKER

All folders have the doc size column present, and that it is totaled.
I changed the Inbox and then selected "Action Upgrade Folder design"
I created an Agent and pasted the Script.

Error message: Variant doesn't contain an object.

Agent Trigger = on event, Action menu selection
Target = All document in the database

The code is under Initialize in the Agent.

verto33,
I'm just finishing the code for you, wait a few minutes.

Marko
ASKER CERTIFIED SOLUTION
Avatar of mbonaci
mbonaci
Flag of Croatia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Could you tell me why you need to know the "size" of a folder? Removing documents from a folder won't reduce the size of a database, since a folder doesn't "contain" documents: it contains references to documents.
Another thought -- not sure if this is what you were looking for..

Open Administrator
Select the Server
Click on the Files tab
Select the Database
On the Tools Bar (right) expand Database
Select Manage Views

List of all views and their sizes appears for selected database.

You can purge the view index.
Just to be clear, this tool marilyng is talking about lists the size of view's index, not size of it's documents.

Marko
Avatar of verto33

ASKER

I pasted the above code. (Created an agent)

I created a button and pasted the code for it,too. I get an error message in the line:

| & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "($Inbox)" ) / 1024, 2 ) ) & " Kb"

The error message is following:

Illegal parenthesized reference: GETDBFOLDERSIZE
verto33,
on the form where the button is:
go to Globals - Declarations and paste the function getDbSize there.

The function will be placed after Terminate form event.

Then preview the form and click on the button.

Hope this helps,
Marko
Avatar of verto33

ASKER

I know the messagebox expression this way:  e.g.

Messagebox "Here my text.", 64, "Warning!"

What does the pipe mean in your line?
verto33,
forget that, that's ok - the pipe is same as quotation mark but you can go to new line (use enter) when using pipe and then you'll get multiline messagebox.


Marko
verto33,
the error message says that it can't find your function (that's because you put it in an agent).
Functions are placed at Global if you want to call them from any form design element's code (like your button).


Hope this helps,
Marko
Avatar of verto33

ASKER

I pasted the code at Global (on the Memo form) no error

Created the button on the Memo form and called it from there. I got the same error in the same line.
Illegal parenthesized reference: GETDBFOLDERSIZE

I know that isn't nice to place it on the Memo form but I don't know where I could place it.
Avatar of verto33

ASKER

I found below solution but when I paste "Option Public" I get the error message:

"Public is not allowed in this modul"

This is what I found:

"Illegal parenthesized reference with the name of the script library is displayed."  
 
Solution
In at least one case, this issue occurred when the "Option Public" line was inadvertently deleted from the Script library options section. Without that line, the script library could not be read by another LotusScript element.
To correct the issue, add Option Public back into the LotusScript Script Library options
 
Avatar of verto33

ASKER

I did following:

im Designer-Client: Tools -> Recompile All LotusScript

but the error is still  there.
Avatar of verto33

ASKER

I found this as well, but didn't help

The function that you are calling is not within the scope of the calling
function or event. If the user defined function is part of a script library
(ex: script library1), then in the form globals, "options", write the statement:
use "script library1".
> I found below solution...
What solution?

When compiling, it also gave you the module or element with the error. It is either in that element, or in the libraries the element uses.

Did you place the code in the (Global) section or in the Form section?

I think you can better place the function in a separate script library, then "Use scriptlibraryname" in the code.
Avatar of verto33

ASKER

Sorry, I didn't paste it in the Global. It's my fault.

Now it works.

I will list all the folder size in one message box. I get a two lines message box when I paste the code from mbonaci.
But if I paste 2 or 3 lines additionally I get an error. "Unexpected: String Constant; Expected Statement"
I want to learn how to create a multiline message box.
Please have a look at the code below, are the pipes in the wrong places?

Msgbox |Inbox folder's size:

| & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "($Inbox)" ) / 1024, 2 ) ) & " Kb"
      | & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "Finance" ) / 1024, 2 ) ) & " Kb"      
      | & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "SLeaders" ) / 1024, 2 ) ) & " Kb"

There's a begin-pipe and an end-pipe, but the pipes can be replaced by { and } ; these characters are easier to be recognised as string delimiters.
Avatar of verto33

ASKER

When I use a start and an end pipe then the code itself between the pipes will be displayed and not the executed code.
When I put the end pipe at the beginning of the last line then the last line's code is executed but the 2 lines above it is displayed as normal text and code isn't executed.

I can have the program to execute the code and display it in two lines but the moment I make three lines I always get an error message.

The messagebox can display normal text in several lines but not execute codes in several lines.

How many pipes should I write and where should I place them if I want a messagebox with three lines?

I don't understand with the  { and } ;
 Should I put { and } ; at the end of all lines?
The following are equivalent:
    "this is a string"
    |this is a string|
    {this is a string}

The same goes for the following equivalent strings spanning more than one line:
    "this is a very" & _
    " long string"
    |this is a very
 long string|
    {this is a very
 long string}

I could be mistaken about the newline inside the string, but that can easily be solved.  
Avatar of verto33

ASKER

Yes, I can display text in multiple lines within a message box with your examples above.
That's all right.

The problem is that if I place not text but codes inside the pipe or brackets, the code will be displayed as normal text.

This is a two liner and works OK. (displays the code's result and not normal text)

Msgbox |Inbox folder's size:

| & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "($Inbox)" ) / 1024, 2 ) ) & " Kb"

How to make a three liner of it? Displaying the e.g. Inbox's size two times in different lines?
Each string should be enclosed in a pair of "" or || or {}

Msgbox |Inbox folder's size:

| & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "($Inbox)" ) / 1024, 2 ) ) & " Kb" _
     & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "Finance" ) / 1024, 2 ) ) & " Kb" _
     & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "SLeaders" ) / 1024, 2 ) ) & " Kb"

or

Msgbox |Inbox folder's size:

| & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "($Inbox)" ) / 1024, 2 ) ) & " Kb" & |
     | & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "Finance" ) / 1024, 2 ) ) & " Kb" & |    
     | & Cstr( Round( getDbFolderSize( s.CurrentDatabase, "SLeaders" ) / 1024, 2 ) ) & " Kb"

Avatar of verto33

ASKER

Thanks,

I'm using the second variation now. It executes the code and displays in different lines.
I didn't succeed before because I didn't put the ampersand sign at the end before the pipe.

The first variation executes and displays the code in a right way but in 1 line. The three sizes are in 1 line.

But I'm glad to have a messagebox with multilines. I wouldn't have imagined that it takes so long to create a multiline box.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of verto33

ASKER

Perfect