Greetings Fellow Monks,

I am trying to build a tool to catalogue M$ Office documents in a spreadsheet, and I already know that it is tantamount to employing the Black Arts to attempt such a thing. The specific task I need to accomplish is to extract the "Title" property from the files -- this is a piece of meta-data that is somehow stored with each file. The tool that I have chosen is Martin Schwartz' seemingly excellent OLE::Storage modules. I say, "seemingly" because I have yet to get any of it to work, but from the documentation it appears to be capable of the task at hand.

The part I'm tripping over is this: the documentation refers throughout to properties (typically named $pps), but does not say how to generate a refence to such a thing.

It is clear how to get a handle to a document, as

my $Startup = new Startup; my $Var = OLE::Storage->NewVar(); my $Doc = OLE::Storage->open($Startup, $Var, $file);
which is pretty much verbatim from the documentation. Then I guess I would need to call a method on $Doc to read the properties structure from the document, perhaps as,
my @pps = $Doc->dirhandles(0);

The dirhandles method is documented as,

@pps == $D -> dirhandles ($pps)
so I'm assuming that $D may be the same as $Doc, and that the dirhandles method returns an array. Am I on the right track here?

I don't have the luxury of time to do trial and error with tese modules, so I'd really love to see some working example code, if such exists. The documentation refers to a couple of example scripts that come with the distribution, but these are LAOLA eamples, and don't use the OLE::Storage modules.

Thanks!

PCS

In reply to Examples of OLE::Storage? by webengr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.