in reply to Getting file attributes/properties using Win32 OLE

Start with GetObject Function
  • Comment on Re: Getting file attributes/properties using Win32 OLE

Replies are listed 'Best First'.
Re^2: Getting file attributes/properties using Win32 OLE
by odog502 (Initiate) on Jan 03, 2010 at 23:23 UTC

    I already have the GetObject function in my script. Or are you implying that I am using it incorrectly? Despite the link being all in VB as far as I can tell Im using it correctly. My only guess is that Im not specifying the optional object class, but since your link is VB I dont know what the perl syntax would be for this.

    The perl example that I am basing my script off of is what I learned from here List Page File Properties

      GetObject can return anything, it varies from system to system.

      So you're supposed to use some calls (i'm guessing QueryObjectType, see in Win32::OLE and on MSDN ) to find what type of object you have, and then look up the available $obj->Methods and $obj->{Properties} on MSDN.

      On my system I get MSHTMLDispHTMLDocument, which is some kind of .NET object ( DispHTMLDocument ), and it doesn't have a FileName or Readable property.

      Maybe you can try Win32::OLE Type Library Browser