以下のコードでは、のようにプロパティ値を指定するdoc.styleSheets[0].rules[0].style.fontweight
と機能しますが、変数を渡すとエラーがスローされます。それはなぜです?
html =
(Ltrim
<html>
<head>
<style type="text/css">
div {
font-weight: bold;
}
</style>
</head>
</html>
)
doc := ComObjCreate("HTMLfile")
doc.write(html)
ChangeCSSRules(doc, "fontweight", "normal")
msgbox % doc.documentElement.innerHTML
ChangeCSSRules(doc, property, value) {
doc.styleSheets[0].rules[0].style[property] := value ; this causes "Error: 0x80020003 - Member not found."
; doc.styleSheets[0].rules[0].style.fontweight := "normal" ; this works
}
[]を使用するとそのエラーが発生するようです。
html =
(Ltrim
<html>
<head>
<style type="text/css">
div {
font-weight: bold;
}
</style>
</head>
</html>
)
doc := ComObjCreate("HTMLfile")
doc.write(html)
doc.styleSheets[0].rules[0].style["fontweight"] := "normal" ; this causes "Error: 0x80020003 - Member not found."
; doc.styleSheets[0].rules[0].style.fontweight := "normal" ; this works
msgbox % doc.documentElement.innerHTML