• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

How to use different fonts while printing one line ?

I have one line of text, concatenated from smaller pieces. On the print out I have to see these pieces printed with the different fonts. If an array, need ideas on how to make Printer.Print strLine(i) stay on the same line without going into vbCrLf at the end of the line.
0
laguna21
Asked:
laguna21
  • 2
  • 2
  • 2
1 Solution
 
gencrossCommented:
Printer.Print "Line1 ";
Printer.Print "Line2"
Printer.EndDoc

This should do it
0
 
gencrossCommented:
More info...

Put a semi-colon after the line.

Your code..

Printer.Print strLine(i);
0
 
laguna21Author Commented:
It doesn't print at all. Any other ideas? I need it to be like this:
                 Header Goes Here(already printing)
SUN                   MON           TUE        WED ...
-------------------------------------------------------
29                    30             31         1
-------------------------------------------------------
12345                |              |123456   |345678 |...
23456(FontStrikethru)|789076 (normal font)


                 Footer goes here
Everything is printing fine, except different fonts on the same line.


 
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
rspahitzCommented:
To switch fonts, simply change them on the printer.  For same line, end the Print line with the semicolon (;), for new line omit it, for "tabbing" use a comma (,).

Example:

dim strDayOfWeekArray() as string

strDayOfWeekArray = split("Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",",")

Printer.Font.Name = "Times New Roman"
Pritner.Font.Size = 12
For i=0 to 6
  Printer.Print strDayOfWeekArray(i),
next i
printer.print ' go to next line

printer.font.name = "Courier New"
printer.print string$(50,"-")

printer.font.name = "Arial"
printer.print "29","30","1","2","3","4","5"

printer.font.name = "Courier New"
printer.print string$(50,"-")

'etc.
printer.enddoc
0
 
rspahitzCommented:
(Actually, the commas will work better if they are applied to the same font name and size, so you probably want to change "Arial" back to "Times New Roman".)

0
 
laguna21Author Commented:
Thank you. It finally worked for me. But this idea was offered first by gencross, so I want to share points between you two.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now