Print to File: Part 2

V

Vel

Hello,

I know it would be best to post this with my original
print to file question, but it's a bit buried, and this
question is a bit more specific, so here goes:

Is there a way to print directly to a file using VB Code
or macros? I.E. I want to print a report to a file and
name that file based on the date/time printed. i.e.

Want to print to the path:
\\Server\Databases\HCFAPrintFiles\
with the file name
=format(Now(), "mmddyyyyhhnn")

So, if I printed the report RepHCFA at 4:12 PM on October
20th, I would want to generate the print file

\\Server\Databases\HCFAPrintFiles\102020031612

Thank You,

Vel.

ps. is it best to save a print file w/o an extension or
as a .txt file?
 
K

Kevin

Is there a way to print directly to a file using VB Code
or macros? I.E. I want to print a report to a file and
name that file based on the date/time printed. i.e.

The OutputTo method of the DoCmd object should do what you
want, e.g.,

DoCmd.OutputTo acOutputReport, <your report name>,
acFormatRTF, <your variable holding the filename and path>

The remaining parameters are optional; all are fully
described in Visual Basic help for the OutputTo method.

Kevin G. Sprinkel
Becker & Frondorf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top