Sub Main document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim arg(0) as new com.sun.star.beans.PropertyValue arg(0).Name = "Text" for i = 99 to 1 step -1 s = "" if i > 2 then bottles1 = "bottles" bottles2 = "bottles" j = i - 1 elseif i > 1 then bottles1 = "bottles"