Description: See the attached VBscript. The Range property is found in a paragraph object accessed another way. Steps to Reproduce: . Actual Results: . Expected Results: . Reproducible: Always User Profile Reset: No Additional Info: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15
Created attachment 142554 [details] Sample VBscript to exercise the problem Output: > $ cscript ../bugreport.vbs > Microsoft (R) Windows Script Host Version 5.812 > Copyright (C) Microsoft Corporation. All rights reserved. > > Creating Writer.Application > Set d = w.Documents > Opening u1.odt > Getting a = w.ActiveDocument > Trying Set r = x1.Paragraphs(1).Range > Enumerating paragraphs in the document with For Each > Paragpraph 1 > Trying Set range = i.Range > C:\cygwin64\home\Tor\lo\bugreport.vbs(38, 5) Microsoft VBScript runtime error: Object doesn't support this property or method: 'i.Range'
The above continues as: > Object doesn't support this property or method: 'i.Range'
The problem seems to be that when doing something like Set d = w.ActiveDocument Set p = d.Paragraphs(1) the p object corresponds to an InterfaceOleWrapper for a SwVbaParagraph, but when doing: For Each i in d.Paragraphs ... Next the i object corresponds to an InterfaceOleWrapper for a SwXParagraph. The handle of enumerations of collections in extensions/source/ole/unoobjw.cxx needs more work.
Suggested fix at https://gerrit.libreoffice.org/#/c/55392/
Tor Lillqvist committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=8015cd21bae6faa8a8d53acf63fe59b375ab6382 tdf#118026: Use ooo::vba::XCollection instead of css::container::XEnumeration It will be available in 6.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.