I am useing the code:
Sub DeleteAllPics()
Dim oDoc As Object
Dim oDrawPage As Object
Dim oShape As Object
Dim iShape As Integer
Dim iSheet As Integer
oDoc = ThisComponent
For iSheet = 0 To oDoc.getSheets().getCount() - 1
oDrawPage = oDoc.getSheets().getByIndex(iSheet).getDrawPage()
For iShape = oDrawPage.getCount() - 1 To 0 Step -1
oShape = oDrawPage.getByIndex(i)
oDrawPage.remove(oShape)
Next iShape
Next iSheet
End Sub
(snippet reformatted by ajlittoz)
From the post [Writer] How to remove all pictures from a document? - #4 by Carrbigdog. But when I try to run it, I get the error message:
BASIC runtime error.
Property or method not found: getSheets.
I would appreciate any information on how to fix this.