I am trying to automatically export from my Outlook98 form: Access97 to excel97. I have a command button to do the process. I keep getting the following error.

Object required 'DoCmd'

This is the line I am using:

Sub excel1
DoCmd.outputTo acOutputQuery,"termexcel",acFormatXLS, & _ "C:\temp\term2001.xls",false
end sub

Can someone see what I am doing wrong.