RE: File Properties API Update

Hi Jacob,

 

I have updated the downloads, they should be OK now.

 

Let me know if you have any problems, I can always e-mail you the setup.

 

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 2/15/2007 11:42:01 PM

RE: File Properties API Update

There is a bug with boolean values. Try writing a boolean value TRUE to custom properties of a file. You can verify that this works by looking at custom properties in Explorer. However, when you read the value back in through the API, it is always false. You can work around it by using a string, but thought I'd save anyone else the hair pulling.

 

Probably not relevant for users in this group, but there is another bug where the API will have problems with the custom property set if the document is an Excel workbook and it has been created by the Save As command. You can add the custom property set back in through the API, but then created string type properties will show as unknown when viewed through Explorer. You can work around this by seeding either the pre or post-save-as workbook with a dummy custom property.

 

Two things about the API that struck me as strange: Fetching a non-existent PropertySet returns null and adding an already-existing PropertySet returns the PropertySet. Would have expected an exception in both cases.

 

I'm floored to only find a .NET API for this purpose in such an obscure place (no offense). Clearly this feature is not getting much use by application programmers in general.

 

Many thanks for creating this API and making it so easy to use. I would never have been able to spend the time to learn the underlying technology write my own, so I'd be missing an important feature from my application.

 

-Steve

 

Posted by: Steven Pearson
Post date: 3/24/2007 10:58:19 AM

RE: File Properties API Update

Hi Steve,

 

Thanks for the feedback.

I have a feeling that the excel problem is a Unicode/ANSI thing. I saw the same thing for Solid Edge files and had to change the string type to ANSI. I tested this with Word 2003 on XP but I'll test again.

What OS and Office version are you using?

I'll also look into the Boolean thing.

 

Which version of .Net are you using? I don't have VS.Net 2003 installed anymore so I may not update that version.

 

With regards to the PropertySets methods: I sort of got caught up in the COM way of thinking and just return null or the PropertySet if it exists. I did this primarily to make code for batch updates of files easier (you can call add to either add a new PropertySet or retrieve an existing one and don't need to do any checks), and to speed things up (a check against null is faster than handling an exception).

Having said that, this behaviour isn't typical for .Net, so this may call for an overload with a throwOnError (or throwIfExists) boolean parameter. I'll put that in with the bug fixes.

 

Once again, thanks for the feedback.

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 3/24/2007 11:42:45 PM

RE: File Properties API Update

Excel issue: What seems to be happening is that depending on how one creates the workbook, it may or may not have a custom property set. Using SaveAs, it does not. I would say that's almost certainly an Excel bug. However, using your lib to create the custom property set works, except that strings can't be written to the property set. That could be either a problem with your lib or that whatever is wrong with the workbook after a SaveAs has other implications beyond what I found. For my particular situation, it's convenient to seed the original workbook with a dummy custom property, so that's a viable workaround.

 

XP, Office 2003, .NET 1.1. Unfortunately I'll be stuck on 1.1 until later this year. However as I have workarounds for both issues, it won't be a problem for me if you don't update the 1.1 version of the API.

 

Thanks!

 

-Steve

 

 

 

Posted by: Steven Pearson
Post date: 3/27/2007 8:43:59 AM

RE: File Properties API Update

Hi Steve,

 

I've found and fixed the boolean bug. I've also found the excel "bug". The problem is that any PropertySets added through the API use the unicode character set. Windows, however only shows ANSI strings in the custom properties window.

It is possible to add new PropertySets that use the ANSI character set, I'll look into adding a character set option in the Add methods.

 

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 3/28/2007 6:56:36 AM

RE: File Properties API Update

 

I see that the links for VS 7 & 8 have been removed. Do you have an updated link? Thx.

 

Posted by: Steven Pearson
Post date: 6/19/2007 10:27:13 AM

RE: File Properties API Update

 

I don't see the posting of the StructuredStorage.dll anymore.  Can you please repost it or forward it to me.

Nevermind.

 

Posted by: Carl Breving
Post date: 8/1/2007 6:22:02 AM

RE: File Properties API Update

 

Hi Guys,

I didn't notice that the attachments disappeared. I've attached the source and dll for the .net 2.0. I'll update the help and the .net 1.1 code soon.

StructuredStorage V8.1

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 8/1/2007 10:50:00 PM

RE: File Properties API Update

 

Hi Calum,

i want use StructuredStorage with XP 64bit but the following Code have a problem - Maybe they know why?

 

' Read the Property's value from the IPropertyStorage interface

hr = propertyStorage.ReadMultiple(1, propertySpec, propValue)

 

 

Posted by: Marco Kreutz
Post date: 12/17/2009 3:08:37 PM

RE: File Properties API Update

Hi Marco,

 

I have had the same problem and gave up trying to fix the VB.Net code - at the moment I am just using this code in 32-bit processes. I am working on a solution using C++/CLI - I hope to get it finished sometime in January.

 

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 12/25/2009 12:24:32 PM