Base error message BASIC runtime error. Property or method not found: drawpages

I’m running the latest version of Libre Office (7.4.6.1) and I’ve read a lot of the responses to this issue and as advised in the Base Guide, used their sample code *excerpt)

Sub Main
Dim oDoc As Object
Dim oDrawpage As Object
Dim oForm As Object

oDoc = thisComponent
oDrawpage = oDoc.drawpage
oForm = oDrawpage.forms.getByName(“MainForm”)
End Suba

This code only work in Writer:

Sub Form_in_Writer()
Dim oDoc As Object
Dim oDrawpage As Object
Dim oForm As Object

	oDoc = ThisComponent
	oDrawPage = oDoc.DrawPage
	oForm = oDrawPage.Forms.getByName("Form")
	
	MsgBox oForm.Name

End Sub

For use in Base you need:

Sub Form_in_Base()
Dim oDoc As Object
Dim oDrawpage As Object
Dim oForm As Object

	oDoc = ThisComponent
	
	oForm = oDoc.FormDocuments.getByName("Form1")
	
	oForm.open()

End Sub

On the other hand, 7.4 is not the latest version. You posted your question in the Basque subforum, but you posted it in English.