Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / September 2006

Tip: Looking for answers? Try searching our database.

recovering file size by VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
matthewgdodds@hotmail.com - 20 Sep 2006 13:51 GMT
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
John Wilson - 20 Sep 2006 14:25 GMT
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
Signature


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

> Doing File -> Properties->in a Powerpoint presentation gets you access
> to the General tab on which the size of the file is available.
[quoted text clipped - 4 lines]
>
> M
matthewgdodds@hotmail.com - 20 Sep 2006 17:49 GMT
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

> I guess like this :
>
[quoted text clipped - 21 lines]
> >
> > M
John Wilson - 20 Sep 2006 18:08 GMT
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
Signature


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

> It certainly did. Many thanks.
>
[quoted text clipped - 46 lines]
> > >
> > > M
Steve Rindsberg - 24 Sep 2006 03:37 GMT
> 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)

> e.g.
> ?ActivePresentation.BuiltInDocumentProperties.item("number of bytes")
[quoted text clipped - 34 lines]
> > >
> > > M

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.