Board index » delphi » Help needed with IPropertySetStorage etc.

Help needed with IPropertySetStorage etc.


2003-09-21 11:26:26 PM
delphi72
Firstly, a big thanks to Deborah Pate and all the others who've posted
source code and help here over the years. Thanks to them and the
archive at Google its taken two days to go from knowing nothing about
IStorage etc to having a working program.
Well....almost working :).....
I'm creating a property set within Word and Excel documents etc. so
that I can store a document ID which links the document with our
database.
I was using the UserDefinedProperties GUID to create a property and
although my program can set the value and read it back in again it
wasn't showing up from the File/Properties menu in Word 2000.
I then created my own GUID and created an entirely new property set in
the document. I can now quite happily amend an Excel document, open it
in Excel and save it again with my info all safe and secure.
However, if I open a Word document that my program has amended and
re-save it, Word removes all but the normal storage streams that you
would expect to find.
I thought about hijacking the "Disposition" user-defined field for my
own purposes. My program definately sets a value called "Disposition"
somewhere in the document which I can read and write but again doesn't
show up in Word and is deleted if I save in Word.
Before I start postiing loads of source code does anyone have any
ideas what I might be doing wrong - or does Word 2000 not preserve
externally created storage streams like it should ?
The idea behind what I am trying to do seemed quite neat and I was
going to extend it to PDF's and other types of document but if I'm
giong to have to battle with every version of Office to implement
what's supposed to be standard functionality for OLE documents then
I'll have to think of an alternative solution.
Many thanks for your help
Barry.
 
 

Re:Help needed with IPropertySetStorage etc.

Firstly, a big thanks to Deborah Pate and all the others who've posted
source code and help here over the years. Thanks to them and the
archive at Google its taken two days to go from knowing nothing about
IStorage etc to having a working program.
Well....almost working :).....
I'm creating a property set within Word and Excel documents etc. so
that I can store a document ID which links the document with our
database.
I was using the UserDefinedProperties GUID to create a property and
although my program can set the value and read it back in again it
wasn't showing up from the File/Properties menu in Word 2000.
I then created my own GUID and created an entirely new property set in
the document. I can now quite happily amend an Excel document, open it
in Excel and save it again with my info all safe and secure.
However, if I open a Word document that my program has amended and
re-save it, Word removes all but the normal storage streams that you
would expect to find.
I thought about hijacking the "Disposition" user-defined field for my
own purposes. My program definately sets a value called "Disposition"
somewhere in the document which I can read and write but again doesn't
show up in Word and is deleted if I save in Word.
Before I start postiing loads of source code does anyone have any
ideas what I might be doing wrong - or does Word 2000 not preserve
externally created storage streams like it should ?
The idea behind what I am trying to do seemed quite neat and I was
going to extend it to PDF's and other types of document but if I'm
giong to have to battle with every version of Office to implement
what's supposed to be standard functionality for OLE documents then
I'll have to think of an alternative solution.
Many thanks for your help
Barry.