-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there is any way to modify / add new properties? #47
Comments
Try calling Save on the OLEPropertiesContainer and/or CompoundFile ? |
I tried - doesn't work either |
@FoggyFinder OLEProperties are currently in development stage. I'll try to give a look at your issue this week but I'm currently involved in other work activities and i can't give a definite time schedule for full implementation. Thank you for your patience. |
Hello @ironfede, do you have any update on this? It would be nice to be able to add new properties to the DocumentSummaryInformation. Thank you. |
I tried having a go at adding/manipulating properties in the document summary information set, using using (CompoundFile cf = new CompoundFile("_Test.ppt"))
{
var dsiStream = cf.RootStorage.GetStream("\u0005DocumentSummaryInformation");
var co = dsiStream.AsOLEPropertiesContainer();
co.Properties.First(prop => prop.PropertyName == "PIDDSI_COMPANY").Value = "RHUBARB";
var newProp = co.NewProperty(OpenMcdf.Extensions.OLEProperties.VTPropertyType.VT_LPSTR, 0x0000000E, "PIDDSI_MANAGER");
newProp.Value = "The Boss";
co.AddProperty(newProp);
co.Save(dsiStream);
cf.SaveAs(@"S:\test\test.ppt");
} And it appeared to work, except that the manager value is displayed ok in structured storage explorer but is shown as I think the issue is that the strings are supposed to be written into the file with null terminator characters included in the length, and the current OpenMcdf function doesn't do it - So I guess that powerpoint must be cutting off the last char or something, rather than the last null? I'll have a go at making
|
@Numpsy , do you think that your recent PRs closes this issue? Many thanks! |
I think the main functionality for writing properties should be working now, besides the other case with unaligned strings discussed in #98 |
Many thanks @Numpsy . |
I have tried this code:
I read and modify the property Title correctly, however I'm not able to save it With cf.Commit the change to the property Title it's not saved Any suggestion or there are code changes on their way? |
Try doing c.Save(foundStream) followed by cf.Commit() ? There are some tests that update properties at
|
That does look to be the problem - If I just use OpenMcdf to open and then save the SummaryInformation section in that file without any other changes then StructuredStorageExplorer gets an error when trying to read it afterwards, and it seems ok when ising the changes from #128. |
Many thanks @Numpsy this code works now
|
I want to have ability modify or add some properties. I tried to do something like that:
But when I'd opened file I didn't see any changes.
Am I doing it in wrong way or it is current library limitation?
The text was updated successfully, but these errors were encountered: