Multiple issues, need help.

davin2929

Board Regular
Joined
Oct 13, 2002
Messages
129
1)I am exporting a report from access to a .rtf file to be opened in word. When i do this the rtf file loses the formatting that the report had in access. does anyone know a better export format that will replicate the formatting in the original access report?

2)below is my module which creates the exports. can you tell me another command besides "RichTextFormat(*.rtf)" as seen below (like html or any other options that i can experiment with) there are 11 regions that i break out one file for each region.

Function OutputOneReg()
On Error GoTo OutputOneReg_Err
yymm = InputBox("Enter date (yymm);", "Date")
If yymm = "" Then Exit Function



For CurrReg = 1 To 11
DoCmd.OpenReport "All Stores by Reg w/sorts", acPreview, "", "[T Master]![Reg1]=" & CurrReg
If CurrReg = 11 Then
DoCmd.OutputTo acReport, "All Stores by Reg w/sorts", "RichTextFormat(*.rtf)", "S:\Sales\Monthly\Downloads\RBMS" & yymm & ".doc", False, ""
Else
DoCmd.OutputTo acReport, "All Stores by Reg w/sorts", "RichTextFormat(*.rtf)", "S:\Sales\Monthly\Downloads\R" & CurrReg & "MS" & yymm & ".doc", False, ""
End If
DoCmd.Close acReport, "All Stores by Reg w/sorts"
Next
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Regarding issue #1:
You can print the report to a Snapshot file. A Snapshot file is similar to a PDF file, only it is already built in to Access, so you don't need an additional product like PDF Writer to create it.

And, the Snapshot Reader program is a free Microsoft download, so anyone can download it and view the reports (even if they don't have Access).

To print a report to a Snapshot file via VBA code, it would something like:
Code:
DoCmd.OutputTo acReport, "ReportName", "SnapshotFormat(*.snp)", "ExportFileName", False, ""

To download the Snapshot viewer, see:
http://www.microsoft.com/downloads/...3f-6d74-423d-8274-8b7e6313edfb&DisplayLang=en
 
Upvote 0

Forum statistics

Threads
1,221,821
Messages
6,162,157
Members
451,750
Latest member
pnkundalia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top