473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Are there formatting commands for the Print #, command

4
I am using an excel sheet to keep track of the finances of my afterschool program. Each week I am creating an invoice for the families that have a different balance, outputing from the excel file to a new word file. Everything works except I was wondering if it is possible to format the output within or before the Print # statement. Just typically word formatting things like size, font, underline and what not. If not, is there an alternative solution that I could use?

I am not entirely new to programming, but am new to VB. I have found answers to all of my other syntax type issues on the web or through the VB help, but had no luck with this problem.

Sample:
'Find the number of C sessions attended
a = Sheets(Week_of).Range("P" & x).Value
'Print C Session # and associated cost
Print #1, a; " Session C (PM) @ $6.00"; Tab(40); "$"; a * 6

I would like to change the font size of the whole print statement as well as underline the a and a * 6 value.

Thanks for your help,
z
Jan 10 '08 #1
3 1858
QVeen72
1,445 Expert 1GB
Hi,

Are you Saving the values to a TextFile and then printing from there or directly Printing to the Printer...?

If using Second option, the "Printer" class has got all the Font Options..

Expand|Select|Wrap|Line Numbers
  1. Printer.FontName = "Courier New"
  2. Printer.FontBold = True
  3. Printer.Print "My First Doc"
  4. Printer.FontBold = False
  5. Printer.FontUnderline = True    
  6. Printer.Print "Second Line"
  7. Printer.NewPage
  8. Printer.EndDoc
  9.  
Regards
Veena
Jan 10 '08 #2
zayyaz
4
I am currently writing to a text file (I want a copy saved for future reference) then printing that file. I also currently don't have a printer where I do most of my coding, so I need a file to test the formatting that will be created.
Jan 10 '08 #3
Killer42
8,435 Expert 8TB
A couple of options come to mind.For instance...
  • Your VB code can drive Word directly, so in theory you could produce as fancy a report as you want.
  • VB includes other ways to produce a "data report", which I don't have any experience with.
  • This would be my preferred method. Add the Microsoft Rich TextBox Control to your project. Then you can throw your text into the RTB, select parts, format them how you want, then just save to an RTF file. Word will interpret RTF format, so it will come out the way you formatted it when loaded into Word. Make sure you save the file with extension ".RTF".
Jan 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: shoo | last post by:
Any one know how to do this? thank Write a simple text-formatting program that produces neatly printed output from input text containing embedded command lines that determine how to format the...
7
by: yoyo | last post by:
Is there any way to make a select in DB2 to output in the following manner: Attr1 value1 Attr2 value2 Attr3 value3 Attr4 value4 Instead of the Attr1 Attr2 Attr3 Attr4
1
by: xtra | last post by:
Hi Folk I have written a module that allows you to type a bunch of commands in the immediate window, for quick access to information when you are creating VB code. Here it is, it may be helpful...
6
by: shoo | last post by:
Any one know how to do this? thank Write a simple text-formatting program that produces neatly printed output from input text containing embedded command lines that determine how to format the...
6
by: gburdell1 | last post by:
When constructing a particularly long and complicated command to be sent to the shell, I usually do something like this, to make the command as easy as possible to follow: commands.getoutput(...
15
by: tmp123 | last post by:
Hello, Thanks for your time. We have very big files with python commands (more or less, 500000 commands each file). It is possible to execute them command by command, like if the commands...
18
by: tcurdts | last post by:
I think what I’m trying to do is very basic but I’m a rank beginner and I’m stuck. I’m using Python 2.4.1 on WindowsNT. I’ve installed UnxUtils, which includes the tar commands for Windows. ...
1
by: raocheng | last post by:
Please see the following code. Suppose I have many shell commands to be executed. And I don't want to fork a sub shell for each command(eg: status,output = commands.getstatusoutput(cmd)) because...
3
by: Tim | last post by:
Folks, I'm trying to format a print string so that it reports progress whilst processing a looping structure with a date time stamp appended to the end of the string. This started out life as a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.