Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2003. I have a user form called "ProcessStatus" that has a text box
called "ProcStat" which is populated with information as a process completes. I have placed a "Print" button control on the form that I want to use to print the contents of the text box. What code would I use to print the text box contents? ProcessStatus.Print does not work as it prints the whole form. The text box has a verical scroll and thus all text is not printed. Thanks for any help you may give. God bless. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
from an Old post:
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 ine " + Str(ctrl) Print #1, tmpstr Next tmpstr = "[End of printing test]" + Chr(12) Print #1, tmpstr Close #1 End Sub To a Network printer First, I went to the immediate window in the VBE to query the activeprinter string ? activePrinter \\ARDAPS01\1D343E on Ne02: then I used the first part in the below code: Sub Macro5() Dim ctrl As Long Dim tmpstr As String Open "\\ARDAPS01\1D343E" 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 Worked for me. Regards, Tom Ogilvy ------------------------------------ So modify the code above to use the textstring in your text box tmpstr = textbox2.Text as an example. -- Regards, Tom Ogilvy "Chaplain Doug" wrote: Excel 2003. I have a user form called "ProcessStatus" that has a text box called "ProcStat" which is populated with information as a process completes. I have placed a "Print" button control on the form that I want to use to print the contents of the text box. What code would I use to print the text box contents? ProcessStatus.Print does not work as it prints the whole form. The text box has a verical scroll and thus all text is not printed. Thanks for any help you may give. God bless. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Tom:
Thank you for replying. However, when I try your code the "LPT1:" just goes into a bit bucket somewhere, as I do not have anything connected to LPT1:, but rather use a network printer. Any other ideas? Thanks. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org "Tom Ogilvy" wrote: from an Old post: 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 ine " + Str(ctrl) Print #1, tmpstr Next tmpstr = "[End of printing test]" + Chr(12) Print #1, tmpstr Close #1 End Sub To a Network printer First, I went to the immediate window in the VBE to query the activeprinter string ? activePrinter \\ARDAPS01\1D343E on Ne02: then I used the first part in the below code: Sub Macro5() Dim ctrl As Long Dim tmpstr As String Open "\\ARDAPS01\1D343E" 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 Worked for me. Regards, Tom Ogilvy ------------------------------------ So modify the code above to use the textstring in your text box tmpstr = textbox2.Text as an example. -- Regards, Tom Ogilvy "Chaplain Doug" wrote: Excel 2003. I have a user form called "ProcessStatus" that has a text box called "ProcStat" which is populated with information as a process completes. I have placed a "Print" button control on the form that I want to use to print the contents of the text box. What code would I use to print the text box contents? ProcessStatus.Print does not work as it prints the whole form. The text box has a verical scroll and thus all text is not printed. Thanks for any help you may give. God bless. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Never mind Tom. I did not read down far enough in your first reply. Thanks.
-- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org "Tom Ogilvy" wrote: from an Old post: 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 ine " + Str(ctrl) Print #1, tmpstr Next tmpstr = "[End of printing test]" + Chr(12) Print #1, tmpstr Close #1 End Sub To a Network printer First, I went to the immediate window in the VBE to query the activeprinter string ? activePrinter \\ARDAPS01\1D343E on Ne02: then I used the first part in the below code: Sub Macro5() Dim ctrl As Long Dim tmpstr As String Open "\\ARDAPS01\1D343E" 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 Worked for me. Regards, Tom Ogilvy ------------------------------------ So modify the code above to use the textstring in your text box tmpstr = textbox2.Text as an example. -- Regards, Tom Ogilvy "Chaplain Doug" wrote: Excel 2003. I have a user form called "ProcessStatus" that has a text box called "ProcStat" which is populated with information as a process completes. I have placed a "Print" button control on the form that I want to use to print the contents of the text box. What code would I use to print the text box contents? ProcessStatus.Print does not work as it prints the whole form. The text box has a verical scroll and thus all text is not printed. Thanks for any help you may give. God bless. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Display contents of a cell in a user form text box -- Excel 2003 VBA | Excel Discussion (Misc queries) | |||
Printing form & contents | Excel Programming | |||
Clear Contents Of A Text Box In User Form | Excel Programming | |||
Submit User Form Contents to next available row | Excel Programming | |||
Control Order on User Form | Excel Programming |