Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^5: How do I obtain a list of values for all the properties of a Word document using Win32::OLE?

by ikegami (Patriarch)
on Jun 11, 2009 at 20:25 UTC ( [id://770761]=note: print w/replies, xml ) Need Help??


in reply to Re^4: How do I obtain a list of values for all the properties of a Word document using Win32::OLE?
in thread How do I obtain a list of values for all the properties of a Word document using Win32::OLE?

Trying to avoid looping entirely might not be possible. I don't see anything in Win32::OLE that would help uniquely identify an object, and that would be required to avoid looping.

You could put limits on your looping (depth, time, number of objects visited, etc). Doing a breadth-first traversal (rather than a depth-first traversal) will make it easier to produce good results while adding limits.

sub depth_first { my ($n) = @_; for ($n->children()) { depth_first($_); } } sub breadth_first { my @todo = @_; while (@todo) { my $n = shift(@todo); push @todo, $n->children(); } }
  • Comment on Re^5: How do I obtain a list of values for all the properties of a Word document using Win32::OLE?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://770761]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2026-03-11 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.