Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run time error 2282? 1

Status
Not open for further replies.

Beren1h

Technical User
Jul 19, 2001
104
US
I'm trying to write a little VB program that will run the DoCmd object in an Access database to export a report in HTML format.

However, I keep getting this error 2282 (formats for HTML are missing from the Windows Registry).

My code is:

Dim objAcc as object
set objAcc = CreateObject("Access.Application")
objAcc.OpenCurrentDatabase
objAcc.DoCmd.OutputTO 3, "TheReport", 0, "save location"
objAcc.CloseCurrentDatabase
objAcc.Quit

If I leave the '0' out of the docmd it prompts me for the export format and everything works fine.

Can someone tell me how I can have the HTML export format automatically selected without having to prompt the user?

Thanks...
 
try

objAcc.DoCmd.OutputTO 3, "TheReport", "HTML (*.html)", "save location"

instead of

objAcc.DoCmd.OutputTO 3, "TheReport", 0, "save location"
 
Cool!

That did the trick!

I had tried "HTML (*.htm)"...so close and yet so far...


Thanks!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top