Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Printing Text from Excel Automation

Sub Macro5()
Dim ctrl as Long
Dim tmpstr as String
Open "LPT1:" For Output As #1
Print #1, "[Start of Printing Test]"
For ctrl = 1 To 10
tmpstr = "Printing Line " + Str(ctrl)
Print #1, tmpstr
Next
tmpstr = "[End of printing test]" + Chr(12)
Print #1, tmpstr
Close #1
End Sub


Change LPT1 to the device name you are trying to print to.

--
Regards,
Tom Ogilvy

"RonF" wrote in message
...
I want to send a string of test to the printer while running in excel
automation. The only way I've found to to this is first put the text in

an
unused cell, select the cell and then print the cell using
selection.printout. Does anyone know of a more direct way?
--
Thanks
RonF
--
Thanks
RonF



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel extended text printing beussg Excel Discussion (Misc queries) 1 December 19th 08 08:11 PM
printing automation wsk Excel Discussion (Misc queries) 0 May 17th 06 02:18 PM
Visio Text (Number) Automation dk Excel Discussion (Misc queries) 0 June 23rd 05 07:02 PM
When printing using Excel the text does not fit in the cell MSUbully Excel Discussion (Misc queries) 2 March 25th 05 06:49 PM
Retrieving text being typed and cursor position using VBA or automation, how? Kallepalle Excel Programming 2 May 23rd 04 12:40 PM


All times are GMT +1. The time now is 12:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"