A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem with OutputTo in Access 2007 + Visual Studio 2005



 
 
Thread Tools Display Modes
  #1  
Old July 17th, 2007, 03:42 PM posted to microsoft.public.access.reports
[email protected]
external usenet poster
 
Posts: 1
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.