In V1, i used this post viewtopic.php?t=114273 by @flyingDman to call a Word VBA function.
Specifically, the code i use is this:
Code: Select all
oWord := ComObjActive("Word.Application")
oWord.selection.wholestory
arange := oWord.Selection.Range
MsgBox, % aRange.text
type := (VT_BYREF := 0x4000) | (VT_I4 := 0x3)
VarSetCapacity(buff, 16, 0)
for k, v in ["x", "y", "w", "h"]
%v% := ComObject(type, &buff + (k - 1)*4)
oWord.ActiveWindow.GetPoint(x, y, w, h, aRange)
for k, v in ["x", "y", "w", "h"]
res .= (k = 1 ? "" : "`n") . v . ": " %v%[]
MsgBox, % res
Now I am switching to V2 and I cannot get it to work... Buffers and ComValues are not my strongsuit. I tried stuff like
Code: Select all
type := (VT_BYREF := 0x4000) | (VT_I4 := 0x3)
buff := Buffer(16, 0)
x := ComValue(type, &buff + (1 - 1)*4)
y := ComValue(type, &buff + (2 - 1)*4)
w := ComValue(type, &buff + (3 - 1)*4)
h := ComValue(type, &buff + (4 - 1)*4)
How to convert the code into V2?