recovering file size by VBA

  • Thread starter Thread starter matthewgdodds
  • Start date Start date
M

matthewgdodds

Doing File -> Properties->in a Powerpoint presentation gets you access
to the General tab on which the size of the file is available.

How that this information be accessed by using VBA?

Thanks

M
 
I guess like this :

Sub pressize()
Dim Isize As Long
With ActivePresentation.BuiltInDocumentProperties
Isize = .Item("number of bytes")
MsgBox ("This presentation has " & Isize & " bytes")
End With
End Sub
--

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
 
It certainly did. Many thanks.

One question - how on earth does one find out about the very existence
of the .item("number of bytes")? I'm more familiar with excel VBA,
where there's great help available by hitting F1 with cursor on, for
example, BuiltInDocumentProperties. No similar help pops up for
powerpoint vba?

And one discrepancy (small, trivial) - how come the size the item
property delivers is not the same as that on the General Tab accessed
through using File, Properties?

e.g.
?ActivePresentation.BuiltInDocumentProperties.item("number of bytes")
says
4092734 & 223361
but fileproperties size is
4157952 & 257536
for two files I've looked at.

Not a discrepancy to worry about but still, any ideas as to an
explanation?

M
 
Can't explain the discrepancy but in answer to your other question!

Sub peek()
For Each p In Application.ActivePresentation _
.BuiltInDocumentProperties
bidpList = bidpList & p.Name & Chr$(13)
Next
MsgBox ("In document properties are " & Chr$(13) & bidpList)
End Sub
--

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
 
One question - how on earth does one find out about the very existence
of the .item("number of bytes")? I'm more familiar with excel VBA,
where there's great help available by hitting F1 with cursor on, for
example, BuiltInDocumentProperties. No similar help pops up for
powerpoint vba?

For reasons unknown, the ever so handy F1 for help key seems broken in 2003, at
least for many users.

But try typing your question or search term into the help textbox at the upper
right of the VBA IDE. That'll at least get you to what help there is. Not
that it's going to win any prizes, mind, but some beats none hands down.
And one discrepancy (small, trivial) - how come the size the item
property delivers is not the same as that on the General Tab accessed
through using File, Properties?

Not sure, but the latter is the operating system's view of the file size.
It seems to be the same as what you get with:

FileLen(ActivePresentation.FullName)
 
Back
Top