In the following code c ends up with the value -16777220 instead of -16777216, as per Microsoft documentation. When I get the color value for a character, or a complete paragraph, that is set to Automatic in the Word document, it returns -16777216 correctly.
I have noticed that in the autocomplete list the wdColorAutomatic shows up as wdColorAutomatic=-1.677722E+7 which inclines me to think there may be some internal rounding error in XOJO. I haven’t tested any other (large) enumeration values at this point. I also tried declaring c as a double and that did not correct the value returned. It seems odd that XOJO would have the number in that format in the autocomplete. I can work around this with my own constant.
Here is another one. I think there is a XOJO problem.
office.wdColorGray05=15987699 according to Microsoft
XOJO autocomplete suggests 1.59877E+7, ie. 15987700
And even worse this one:
office.wdColorBlue=16711680 according to Microsoft but XOJO returns 13893630
I just lost all confidence in these XOJO provided enumeration constants. Fortunately, only the Automatic color value matters to me at the moment and I can get around it. If I’m causing the problem, I have no idea how.
The values are wrong when assigned to a variable. That is how I discovered it. My code depended on the value of wdColorAutomatic being -16777216. The autocomplete display perhaps hints at an internal assumption/problem in Xojo, or in how these constants were incorporated. It also strikes me as odd that the autocomplete displays numbers that are always integers in that manner.
[quote=430277:@Damien Callaghan]
I have noticed that in the autocomplete list the wdColorAutomatic shows up as wdColorAutomatic=-1.677722E+7 which inclines me to think there may be some internal rounding error in XOJO.
[/code][/quote]
Enums are definitely integers
But these arent enums
Almost looks like they are set up as doubles which would be a problem