Zend certified PHP/Magento developer

writeDate Macro not working in version 7.6.4 rev2 after years of using it

I have been using this macro for years to assign todays date as the default date to a field
when no date is selected. I downloaded version 7.6.4 rev2 and it stopped working.

REM This macro writes the date of today to the Date Field myDateField

Sub writeDate

Dim today As New com.sun.star.util.Date

today.Month = Month( Now )

today.Day = Day( Now )

today.Year = Year( Now )

form = ThisComponent.DrawPage.Forms(0)  ' first form

form.datReceivedDate.BoundField.UpdateDate( today )

End Sub

Error on this line form = ThisComponent.DrawPage.Forms(0) ‘ first form

Basic runtime error. Property or method not found DrawPage.