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.
laguna21Asked:
Who is Participating?
 
rspahitzConnect With a Mentor Commented:
(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
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
 
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
 
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
All Courses

From novice to tech pro — start learning today.