Skip to content
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

Change VTType of a property #202

Open
farfilli opened this issue Oct 25, 2024 · 2 comments
Open

Change VTType of a property #202

farfilli opened this issue Oct 25, 2024 · 2 comments
Labels

Comments

@farfilli
Copy link

What is the best method to change the VTType of a property?

I'm asking this because I noticed that when you create a numeric custom property in Word, its VTType depends on the value assigned to the property. If I assign an integer the VTType will be VT_I4 instead if I assign a decimal value the VTType will be VT_R8. This seems reasonable initially, but what happens when a user changes the values?

Well, if I change the previous integer value of the numeric custom property to a decimal value, the VTType will change from VT_I4 to VT_R8 and it still makes sense. Same way if I change the previously decimal value to integer the numeric custom property VTType will change from VT_R8 to VT_I4.

I noticed that the custom property ID doesn't change when the VTType changes, therefore I guess the software updates its value.

How do we manage this situation with openmcdf? VTType is read-only, I guess the solution is to delete the property and recreate it with the same ID, the new VTType, and the new value. Is this the right approach? Or perhaps the VTType should be read-write?

Note that Solid Edge files have the same behavior so it must be an MS specific

image

@Numpsy
Copy link
Contributor

Numpsy commented Nov 1, 2024

I've just been doing it by deleting and readding the properties, though I'm mostly working with a specific set of custom properties that need to be a specific type, so if the current type is different then it's wrong anyway.

I'm not sure what the best approach in general is - changing the property type for user defined properties might be useful sometimes, but all the default ones (In SummaryInformation etc) have fixed types defined by Microsoft, so it doesn't really make sense to allow those to be changed.

@farfilli
Copy link
Author

farfilli commented Nov 1, 2024

Yes my issue it's about custom properties where I can change iteratively the type but more important, for integer versus decimal it change seamlessly by the software

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants