I'm trying to use Application.GetApplicationPreferenceValue, but it's not working for me when the GroupName contains a space.
Sub test_get_app_preference_01() Debug.Print Application.GetApplicationPreferenceValue("Directories", "AutoBackup") End Sub Sub test_get_app_preference_02() Debug.Print Application.GetApplicationPreferenceValue("File Locations", "DefaultFillPath") End Sub Sub test_get_app_preference_03() Debug.Print Application.GetApplicationPreferenceValue("NodeEditTool", "TransientSkiaGpuAccelerated") End Sub Sub test_get_app_preference_04() Debug.Print Application.GetApplicationPreferenceValue("ShapingTool", "EffectRate") End Sub Sub test_get_app_preference_05() Debug.Print Application.GetApplicationPreferenceValue("FilletScallopChamfer", "FilletRadius") End Sub
So, in the above subs, the ones with GroupNames that do not contain spaces all work as expected.
The one with the GroupName "File Locations" gets me this:
Is there some syntax of which I'm unaware for handling the GroupNames that have one or more spaces in them?
I am afraid that GroupName or KeyName does not exist...
Where from did you take these groups and keys strings? At first glance i suppose that "DefaultFillPath" should be "DefaultFilePath"...
For instance, in my case (X8 installation) i do not receive the same error only for the next to procedures:
Sub test_get_app_preference_04() Debug.Print Application.GetApplicationPreferenceValue("ShapingTool", "EffectRate") End Sub Sub test_get_app_preference_05() Debug.Print Application.GetApplicationPreferenceValue("FilletScallopChamfer", "FilletRadius") End Sub'I also found a 'sister' API: SetApplicationPreferenceValue. I couldn't figure out how to use it in order to set something...
Thank you for looking, and for trying this!
I was using 2018. It makes sense to me that the _03 sub would not work in X8, as it refers to GPU acceleration.
I don't understand, though, why the _01 sub does not work with X8. If I look at the settings.ini file, that group and key are present.
Again, both _01 and _03 work in 2018.
Yes, what I really wanted to do was to use SetApplicationPreferenceValue.
I, too, cannot figure out how to use that!
I can assure you that only _04 and _05 works in X8. At least, in my installation...
All the rest return exactly the same error. The one you mentioned.
If you only want to use SetGetApplicationPreferenceValue, I figure it out, I think. At least for one case. The one working for _04. Maybe some of them would be read only:
1
Application.SetApplicationPreferenceValue "ShapingTool", "EffectRate", 0.3
Initially its value was 0.2 and the value is changed as expected. In my case Document unit = cdrMillimeter...
Where can I find that settings.ini file containing the data you just mentioned? I looked for it and I found such a file in user Draw Workspace, but it containes only one insipid row: "; Please do not remove! This line is required by Winnt4."
The ini file of Photo-Paint contains data... Will it be empty when Corel is working...?
Where did you find any documentation/reference about using of this API?
one funny thing. I run this code:
MsgBox Application.GetApplicationPreferenceValue("FilletScallopChamfer", "ScallopRadius")Application.SetApplicationPreferenceValue "FilletScallopChamfer", "ScallopRadius", 12500
MsgBox shows default value 12700, but next line with SetApplicationPreferenceValue returns error "Method SetApplicationPreferenceValue... is failed".
I run this code again. MsgBox shows this time 12500, but next line shows error again
Interesting! When I saw the "failed" error, I did not check to see if it had actually changed the value.