If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Problem with OutputTo in Access 2007 + Visual Studio 2005
Please forgive me if I'm posting to the wrong group.
I'm converting an application I wrote in Visual Studio 2002 + MS Access 2002. It was a console application that was executed from an Access Macro. The application would open up the current Access Database, it would export a particular report to HTML, then it would call a webservice on a remote server to send out the exported file via email to a distribution list. I'm converting this to Visual Studio 2005 + MS Access 2007, so that I can export the reports to PDF. Everything converted over just fine, except that I can no longer call the OutputTo method of the DoCmd object. Here's the code (VB.Net - VS2005): Dim oAccess As Access.Application oAccess = New Access.Application oAccess.OpenCurrentDatabase("SOMEDATABASEPATH", False) oAccess.DoCmd.OutputTo(Microsoft.Office.Interop.Ac cess.AcOutputObjectType.acOutputReport, "Report1", "PDFFormat(*.pdf)", "SOMEEXPORTPATH", False, "", 0, Access.AcExportQuality.acExportQualityPrint) oAccess.CloseCurrentDatabase() oAccess.Quit() oAccess = Nothing I've also tried: Dim oAccess As Access.Application Dim oCommand As Access.DoCmd oAccess = New Access.Application oCommand = oAccess.DoCmd oAccess.OpenCurrentDatabase("SOMEDATABASEPATH", False) oCommand.OutputTo(Microsoft.Office.Interop.Access. AcOutputObjectType.acOutputReport, "Report1", "PDFFormat(*.pdf)", "SOMEEXPORTPATH", False, "", 0, Access.AcExportQuality.acExportQualityPrint) oAccess.CloseCurrentDatabase() oAccess.Quit() oAccess = Nothing But I always get the error: "OutputTo' is ambiguous because multiple kinds of members with this name exist in interface 'Microsoft.Office.Interop.Access.DoCmd' I guess this is saying that the Access.DoCmd object implements the interface DoCmd, but it doesn't know what the underlying object type is? What am I doing wrong here? Thanks for any help you can provide. |
Thread Tools | |
Display Modes | |
|
|