OutputTo not available in Access 2007.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to automate the export of an Access 2007 report to html / excel /
rtf using the DoCmd.OutputTo action, but this does not seem to be available.
Can anyone tell me if a new command / action has been created to replace
this action?
Tx
 
Apologies, I was instantiating the command object incorrectly, the following
code works.

Dim oAccess As Microsoft.Office.Interop.Access.Application
Dim oCommand As Microsoft.Office.Interop.Access.DoCmd

oAccess = New Microsoft.Office.Interop.Access.Application
oAccess.OpenCurrentDatabase("C:\temp\TestReports.accdb", False)

oCommand = oAccess.DoCmd


oCommand.OutputTo(Microsoft.Office.Interop.Access.AcOutputObjectType.acOutputReport, "Customer Address Book", "*.txt", "C:\temp\Customer Address Book.txt")

oAccess.CloseCurrentDatabase()

oCommand = Nothing
oAccess = Nothing
 
Back
Top