SaveAsText from a form

I have used SaveAsText with forms with previous versions. It’s no longer supported. What is the best solution to replace that can include headers, footers and calculations?