Solved

How to use different fonts while printing one line ?

Posted on 2002-05-16
6
137 Views
Last Modified: 2013-12-03
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
Comment
Question by:laguna21
  • 2
  • 2
  • 2
6 Comments
 
LVL 4

Expert Comment

by:gencross
Comment Utility
Printer.Print "Line1 ";
Printer.Print "Line2"
Printer.EndDoc

This should do it
0
 
LVL 4

Expert Comment

by:gencross
Comment Utility
More info...

Put a semi-colon after the line.

Your code..

Printer.Print strLine(i);
0
 

Author Comment

by:laguna21
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
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
 
LVL 22

Accepted Solution

by:
rspahitz earned 200 total points
Comment Utility
(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
 

Author Comment

by:laguna21
Comment Utility
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now