Exporting a report to windows clipboard

  • Thread starter Thread starter buster_brown234
  • Start date Start date
B

buster_brown234

Hi,

I am wondering if there is a way of exporting a report to
the windows clipboard. We use a database to collect
information that needs to be sent by fax - however office
applications do not have access to the fax server. Only
our custom built software can send faxes.

At the moment I am using a rather round-about way of
exporting the report to word, and relying on the operator
to ctrl+a then ctrl+c to copy to clipboard, then ctrl+v to
paste into our messaging software -

Private Sub Command62_Click()

DoCmd.Echo False
DoCmd.OpenReport "MarepReport",acViewPreview,
"QueryPrintExistingRecord"
DoCmd.OutputTo acSendReport, "MarepReport",
acFormatRTF, "S:\Marep\MAREP
DATABASE\MarepTextFile\MarepReport.RTF", True
DoCmd.Close acReport, "MarepReport"
DoCmd.Echo True

End Sub

Anybody and thoughts?

Any help appreciated.
 
Hi Buster,

I can't think of a really elegant way of doing it; the Report object
doesn't seem to expose anything useful. Here's one approach, though:

1) save the report to disk as RTF
2) read the file's contents into a string
3) use the DataObject object from the MSForms library to
put the string on the clipboard, using the clipboard format
argument to signal that it's rich text, not plain text.
(IIRC some but not all of the Clipboardformat constants
in the Windows API work here, but there's an element of #
trial and error.)
4) Paste (or perhaps Paste Special) into the fax app.

But first, take a look at the treasure-house that is
http://www.lebans.com in case there's a cunning utility ready to use.
 
Back
Top