|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Print FunctionHello Friends
Am using print function in VB6.0. Have given commands to change fonts depending on requirement. First time it prints properly as per the commands, when the same is executed immediately in succession, it prints in draft mode. Have to exit the program and re-run to get the desired font. Any suggestions please. thanks n rgds B.Satish "Satish" <Sat***@discussions.microsoft.com> wrote in message Post the *exact* code you are using. Post *all* of it. If it is too much to news:0625F79B-DD22-4117-A573-32B2A821D0BD@microsoft.com... > Am using print function in VB6.0. Have given commands to change > fonts depending on requirement. First time it prints properly as per > the commands, when the same is executed immediately in succession, > it prints in draft mode. Have to exit the program and re-run to get the > desired font. Any suggestions please. post (or if it relies on gathering data from some external source) then create a new *small* self contained VB application *that exhibits the problem same you are having* and post *all* of that code. Also tell us what version of Windows you are using and what printer you are using and whether it is a locally connected printer or a network printer. The more detail you can give us the better. Mike Hi Mike
Am using Windows 98 with Epson Lx- 800 printer. While I use Deskjet printers it is working properly. Code is given below. Printer.FontTransparent = True Printer.FontBold = True Printer.FontName = TIMESNEWROMAN Printer.FontSize = 18 Printer.Orientation = 1 Printer.Print Chr(13) Printer.Print Chr(9) + Chr(9) + Chr(9) + "SATISH LTD" Printer.FontBold = False Printer.FontName = TIMESNEWROMAN Printer.FontSize = 12 Printer.Print Chr(9) + "From: MANAGER" Printer.Print Chr(9) + " ACCOUNTS." Printer.Print Chr(13) Printer.Print Chr(9) + "To:" + Chr(9) + CStr(REC1!AGENT) Printer.Print Chr(9) + Chr(9) + CStr(REC1!ADDR1) Printer.Print Chr(9) + Chr(9) + CStr(REC1!ADDR2) Printer.Print "PREPARED BY:" Printer.Print Chr(9) + "Signature:_________________" + Chr(9) + Chr(9) + CStr(Date) Printer.Print Chr(13) Printer.Print Chr(9) + "Invoice No:________________" + Chr(9) + "Date:__________" Printer.EndDoc Thanks for your response. Satish Show quoteHide quote "Mike Williams" wrote: > "Satish" <Sat***@discussions.microsoft.com> wrote in message > news:0625F79B-DD22-4117-A573-32B2A821D0BD@microsoft.com... > > > Am using print function in VB6.0. Have given commands to change > > fonts depending on requirement. First time it prints properly as per > > the commands, when the same is executed immediately in succession, > > it prints in draft mode. Have to exit the program and re-run to get the > > desired font. Any suggestions please. > > Post the *exact* code you are using. Post *all* of it. If it is too much to > post (or if it relies on gathering data from some external source) then > create a new *small* self contained VB application *that exhibits the > problem same you are having* and post *all* of that code. Also tell us what > version of Windows you are using and what printer you are using and whether > it is a locally connected printer or a network printer. The more detail you > can give us the better. > > Mike > > > > > I have a hunch I know what is wrong - see in-line
On Thu, 20 Oct 2005 01:35:03 -0700, =?Utf-8?B?U2F0aXNo?= <Sat***@discussions.microsoft.com> wrote: >Hi Mike Printer.Orientation = 1 '<==== DO THIS FIRST ====> Am using Windows 98 with Epson Lx- 800 printer. While I use Deskjet >printers it is working properly. Code is given below. > >Printer.FontTransparent = True >Printer.FontBold = True >Printer.FontName = TIMESNEWROMAN >Printer.FontSize = 18 Show quoteHide quote >Printer.Print Chr(13) >Printer.Print Chr(9) + Chr(9) + Chr(9) + "SATISH LTD" > >Printer.FontBold = False >Printer.FontName = TIMESNEWROMAN >Printer.FontSize = 12 > >Printer.Print Chr(9) + "From: MANAGER" >Printer.Print Chr(9) + " ACCOUNTS." > >Printer.Print Chr(13) >Printer.Print Chr(9) + "To:" + Chr(9) + CStr(REC1!AGENT) >Printer.Print Chr(9) + Chr(9) + CStr(REC1!ADDR1) >Printer.Print Chr(9) + Chr(9) + CStr(REC1!ADDR2) > >Printer.Print "PREPARED BY:" >Printer.Print Chr(9) + "Signature:_________________" + Chr(9) + Chr(9) + >CStr(Date) >Printer.Print Chr(13) >Printer.Print Chr(9) + "Invoice No:________________" + Chr(9) + >"Date:__________" >Printer.EndDoc > >Thanks for your response. >Satish > >"Mike Williams" wrote: > >> "Satish" <Sat***@discussions.microsoft.com> wrote in message >> news:0625F79B-DD22-4117-A573-32B2A821D0BD@microsoft.com... >> >> > Am using print function in VB6.0. Have given commands to change >> > fonts depending on requirement. First time it prints properly as per >> > the commands, when the same is executed immediately in succession, >> > it prints in draft mode. Have to exit the program and re-run to get the >> > desired font. Any suggestions please. >> >> Post the *exact* code you are using. Post *all* of it. If it is too much to >> post (or if it relies on gathering data from some external source) then >> create a new *small* self contained VB application *that exhibits the >> problem same you are having* and post *all* of that code. Also tell us what >> version of Windows you are using and what printer you are using and whether >> it is a locally connected printer or a network printer. The more detail you >> can give us the better. >> >> Mike >> >> >> >> >> Thanks French,
Will try and advice Satish Show quoteHide quote "J French" wrote: > I have a hunch I know what is wrong - see in-line > > On Thu, 20 Oct 2005 01:35:03 -0700, =?Utf-8?B?U2F0aXNo?= > <Sat***@discussions.microsoft.com> wrote: > > >Hi Mike > > Am using Windows 98 with Epson Lx- 800 printer. While I use Deskjet > >printers it is working properly. Code is given below. > > > >Printer.FontTransparent = True > >Printer.FontBold = True > >Printer.FontName = TIMESNEWROMAN > >Printer.FontSize = 18 > Printer.Orientation = 1 '<==== DO THIS FIRST ==== > >Printer.Print Chr(13) > >Printer.Print Chr(9) + Chr(9) + Chr(9) + "SATISH LTD" > > > >Printer.FontBold = False > >Printer.FontName = TIMESNEWROMAN > >Printer.FontSize = 12 > > > >Printer.Print Chr(9) + "From: MANAGER" > >Printer.Print Chr(9) + " ACCOUNTS." > > > >Printer.Print Chr(13) > >Printer.Print Chr(9) + "To:" + Chr(9) + CStr(REC1!AGENT) > >Printer.Print Chr(9) + Chr(9) + CStr(REC1!ADDR1) > >Printer.Print Chr(9) + Chr(9) + CStr(REC1!ADDR2) > > > >Printer.Print "PREPARED BY:" > >Printer.Print Chr(9) + "Signature:_________________" + Chr(9) + Chr(9) + > >CStr(Date) > >Printer.Print Chr(13) > >Printer.Print Chr(9) + "Invoice No:________________" + Chr(9) + > >"Date:__________" > >Printer.EndDoc > > > >Thanks for your response. > >Satish > > > >"Mike Williams" wrote: > > > >> "Satish" <Sat***@discussions.microsoft.com> wrote in message > >> news:0625F79B-DD22-4117-A573-32B2A821D0BD@microsoft.com... > >> > >> > Am using print function in VB6.0. Have given commands to change > >> > fonts depending on requirement. First time it prints properly as per > >> > the commands, when the same is executed immediately in succession, > >> > it prints in draft mode. Have to exit the program and re-run to get the > >> > desired font. Any suggestions please. > >> > >> Post the *exact* code you are using. Post *all* of it. If it is too much to > >> post (or if it relies on gathering data from some external source) then > >> create a new *small* self contained VB application *that exhibits the > >> problem same you are having* and post *all* of that code. Also tell us what > >> version of Windows you are using and what printer you are using and whether > >> it is a locally connected printer or a network printer. The more detail you > >> can give us the better. > >> > >> Mike > >> > >> > >> > >> > >> > > "Satish" <Sat***@discussions.microsoft.com> wrote in message First do what Jerry has suggested and move the Printer.Orientation line to news:D25DF393-FBE7-4444-AE33-A15E7A81D393@microsoft.com... > Hi Mike Am using Windows 98 with Epson Lx- 800 printer. >While I use Deskjet printers it is working properly. Code is > given below. near the top of your code. Also, instead of using Print Chr(13) you need to use *both* a carriage return and a line feed. So, knock out the Print Chr(13 and use Print vbCrLf instead. Also, get rid of those tabs (Chr(9)). They're always a problem. Use CurrentX instead. Also (and most importantly) what is this TIMESNEWROMAN variable? Has it been defined? If not then define it, otherwise use Printer.Font.Name = "Times New Roman" instead. By the way, place the line "Option Explicit" in the declarations section of all your modules. Post again with your new code if it still doesn't work. Mike Thanks Jerry & Mike
Problem is solved after modification of "Times New Roman". Have also modified CHR(13) to vbcrlf. Thanksf or the suggestions. Saitsh Show quoteHide quote "Mike Williams" wrote: > "Satish" <Sat***@discussions.microsoft.com> wrote in message > news:D25DF393-FBE7-4444-AE33-A15E7A81D393@microsoft.com... > > > Hi Mike Am using Windows 98 with Epson Lx- 800 printer. > >While I use Deskjet printers it is working properly. Code is > > given below. > > First do what Jerry has suggested and move the Printer.Orientation line to > near the top of your code. Also, instead of using Print Chr(13) you need to > use *both* a carriage return and a line feed. So, knock out the Print Chr(13 > and use Print vbCrLf instead. Also, get rid of those tabs (Chr(9)). They're > always a problem. Use CurrentX instead. Also (and most importantly) what is > this TIMESNEWROMAN variable? Has it been defined? If not then define it, > otherwise use Printer.Font.Name = "Times New Roman" instead. By the way, > place the line "Option Explicit" in the declarations section of all your > modules. Post again with your new code if it still doesn't work. > > Mike > > > > > |
|||||||||||||||||||||||