1. Go to design or layout view of the form
2. Right click the command button and select "Properties" ==> "Event" tab
3. Go to "On click", select "...", on popup box select "Macro Builder"
4. Under "Action Catalog" on the right (click "Action Catalog" under "Design" tab on the top if it is shown", select "Data Import/Export"==> "ExportWithFormatting"