The testing code is located below. It fails at "For myStoryRange, In StoryRange" with the error message '_NewEnum' is not a method.
Code: Select all
^Space::
oWord := ComObjActive("Word.Application")
StoryRange := {}
StoryRange := oWord.ActiveDocument.StoryRanges
For myStoryRange, In StoryRange
{
myStoryRange.Text := "Hello"
}
return
Code: Select all
^Space::
oWord := ComObjActive("Word.Application")
StoryRange := {}
StoryRange := ComObjArray(ComObjType(oWord.ActiveDocument.StoryRanges.Item(1)), 8)
StoryRange := oWord.ActiveDocument.StoryRanges
For myStoryRange, In StoryRange
{
myStoryRange.Text := "Hello"
}
return