Print textbox control directly to default printer

  • Thread starter Thread starter Hal Heinrich
  • Start date Start date
H

Hal Heinrich

Currently my users cut and paste the contents of the
textbox into Notepad, then print from Notepad.

I'd like to give them a button that prints directly to
the default printer.

Note that DoCmd.PrintOut is inadequate because there is
typically more text than can be displayed in the textbox.

Thanks in advance for any help,
Hal
 
Thank you for your reply. However, you questioned the
question and I'm looking for an answer. The question is
technically specific, and I have my reasons for wanting
an answer.

Hal
-----Original Message-----
Hal,

Do you not like your users <gr>??? Looks like you are
thinking that you are needing to move in the right
direction. Why not just give them a button they hit that
prints the info they want to a report? This is what the
purpose of reports are.

The report wizard can help you make a report and you can
just select the data that you are interested in seeing, then
the command button wizard can help you launch it, although
you may need to get back to us on details of how to limit it
to the data of that one record. Usually it is done with
something like this...

DoCmd.OpenReport "YourReportName, acViewPreview, , "[CustID]
= " & Me!CustID


--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Hal Heinrich said:
Currently my users cut and paste the contents of the
textbox into Notepad, then print from Notepad.

I'd like to give them a button that prints directly to
the default printer.

Note that DoCmd.PrintOut is inadequate because there is
typically more text than can be displayed in the textbox.

Thanks in advance for any help,
Hal


.
 
You can use SelStart and SelLength to highlight the text (if it is not
already highlighted) and DoCmd.RunCommand acCmdCopy to copy to the
Clipboard, from which you can manually paste into Notepad.

If Notepad were a COM-automation-enabled application, which I believe it is
NOT, you could control it via automation to paste the information. You
might, however, be able to SHELL to Notepad, and (very carefully) use
SendKeys to do the paste and print. I'd be interested to hear your results
on this part, if you make it work.

On the other hand, if those users have Microsoft Word, you _can_ control
that from Access via automation, and a little searching of the archives of
this and comp.databases.ms-access at http://groups.google.com should give
you some leads on how to do so.

Larry Linson
Microsoft Office MVP
 
Hal,

You did ask how to print the contents of that text box
control from a button and the method of just dropping that
one field on a report with the control set to CanGrow would
do what exactly what you asked for in your original post. I
think that I did give you a reasonable solution, albeit
maybe not the one you were looking for or expecting.

Regards,

Gary

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Hal Heinrich said:
Thank you for your reply. However, you questioned the
question and I'm looking for an answer. The question is
technically specific, and I have my reasons for wanting
an answer.

Hal
-----Original Message-----
Hal,

Do you not like your users <gr>??? Looks like you are
thinking that you are needing to move in the right
direction. Why not just give them a button they hit that
prints the info they want to a report? This is what the
purpose of reports are.

The report wizard can help you make a report and you can
just select the data that you are interested in seeing, then
the command button wizard can help you launch it, although
you may need to get back to us on details of how to limit it
to the data of that one record. Usually it is done with
something like this...

DoCmd.OpenReport "YourReportName, acViewPreview, , "[CustID]
= " & Me!CustID


--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Hal Heinrich said:
Currently my users cut and paste the contents of the
textbox into Notepad, then print from Notepad.

I'd like to give them a button that prints directly to
the default printer.

Note that DoCmd.PrintOut is inadequate because there is
typically more text than can be displayed in the textbox.

Thanks in advance for any help,
Hal


.
 
Gary provided the exact solution of creating a report that I would have
suggested.

--
Duane Hookom
MS Access MVP


Hal Heinrich said:
Thank you for your reply. However, you questioned the
question and I'm looking for an answer. The question is
technically specific, and I have my reasons for wanting
an answer.

Hal
-----Original Message-----
Hal,

Do you not like your users <gr>??? Looks like you are
thinking that you are needing to move in the right
direction. Why not just give them a button they hit that
prints the info they want to a report? This is what the
purpose of reports are.

The report wizard can help you make a report and you can
just select the data that you are interested in seeing, then
the command button wizard can help you launch it, although
you may need to get back to us on details of how to limit it
to the data of that one record. Usually it is done with
something like this...

DoCmd.OpenReport "YourReportName, acViewPreview, , "[CustID]
= " & Me!CustID


--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Hal Heinrich said:
Currently my users cut and paste the contents of the
textbox into Notepad, then print from Notepad.

I'd like to give them a button that prints directly to
the default printer.

Note that DoCmd.PrintOut is inadequate because there is
typically more text than can be displayed in the textbox.

Thanks in advance for any help,
Hal


.
 
Back
Top