Type Mismatch with Hex Color
Posted: 15 Jul 2019, 13:02
The goal of this script is a simple color picker for PowerPoint: When the hotkey is pressed, the selected object's fill color will update to the color under the cursor position.
I'm receiving a "Type Mismatch" error for this line:
But such a line does work:
I suspect it's because %color% is acting like a string "0xFFFFFF" instead of a hex number 0xFFFFFF
Any ideas how to fix this type mismatch?
Code: Select all
pp := ComObjActive("Powerpoint.Application")
F12::
MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%
pp.ActiveWindow.Selection.ShapeRange.Fill.ForeColor.RGB := %color%
return
Code: Select all
pp.ActiveWindow.Selection.ShapeRange.Fill.ForeColor.RGB := %color%
Code: Select all
pp.ActiveWindow.Selection.ShapeRange.Fill.ForeColor.RGB := 0xFFFFFF
Any ideas how to fix this type mismatch?