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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate Printing Selected Text From a Memo Field

Status
Not open for further replies.

sfordgoat

MIS
Dec 9, 1999
1
I have a multi-page tab control in a form that has a memo field for client notes. My users would like to block text in the memo field and print out the selected text. How do I setup a control on the form to push the selected text to the printer? If they highlight the text, right click and copy to the clipboard, is there an easy way to print from the clipboard? or must the text be pasted into an application such as Wordpad?
 
I would open a new form and paste text to this. Make a new blank form and place a text field and make sure that property CanGrow is set to Yes.<br>
<br>
Then make a new module and function which opens this new form, does the copy&paste routine and prints and closes the form:<br>
<br>
In Access97:<br>
Function PrintMemo()<br>
RunCommand (acCmdCopy)<br>
DoCmd.OpenForm &quot;frmPrintMemo&quot;<br>
RunCommand (acCmdPaste)<br>
RunCommand (acCmdPrint)<br>
DoCmd.Close &quot;frmPrintMemo&quot;<br>
End Function<br>
<br>
To run this code I would use Autokeys macro and assign some easy key combination that users can press after selecting the text (check Autokeys from Access Help). <br>
<br>
If anyone knows how assign this code to command button without 'losing' focus on selected text, please feel to improve this solution.<br>
<br>
Good luck,<br>
<br>
Al<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top