By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,636 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,636 IT Pros & Developers. It's quick & easy.

How to output a text file with a page break

P: n/a
This is not as simple as I thought.

Using Print # I am outputting content for a text file. I wanted at certain
points to force a page break so I thought a Chr(12) for a form feed may
work.

If opened in notepad and printed it doesn't. In WordPad or Word it sort of
does but puts a blank line at the start of each new page.

I then thought of an RTF file but this requires a heap of other control and
formatting info. In Notepad it looks crap.

The requirement is that we are sending a list of orders to someone and they
will want to view on screen and print this out. The page break is to
separate orders.

I don't know what they have installed but feel safe in that they will have
the 3 apps above. Can't count on a browser so HTML is out. Text file seemed
the easiest.

It will be sent as an attachment to an email.

Any ideas.

Jeff
Jan 27 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
End a print statement with a semicolon to prevent it going to a new line
after printing. See my example inline with your original post...
Jeff wrote:
This is not as simple as I thought.

Using Print # I am outputting content for a text file. I wanted at certain
points to force a page break so I thought a Chr(12) for a form feed may
work.

If opened in notepad and printed it doesn't. In WordPad or Word it sort of
does but puts a blank line at the start of each new page.
print #9, chr(12) would put a blank line at the top of each page
print #9, chr(12); would not (note the semicolon)
I then thought of an RTF file but this requires a heap of other control and
formatting info. In Notepad it looks crap.

The requirement is that we are sending a list of orders to someone and they
will want to view on screen and print this out. The page break is to
separate orders.

I don't know what they have installed but feel safe in that they will have
the 3 apps above. Can't count on a browser so HTML is out. Text file seemed
the easiest.

It will be sent as an attachment to an email.

Any ideas.

Jeff

Jan 27 '06 #2

P: n/a
Jeff,
If this is a regular email attachment, you can output the report as
Snapshot. Your end used can download (or you can download for them)
from Microsoft the Access Snapshot viewer. This will provide
additional security, printing flexibility, and simplified support.
Your page breaks can be managed in the report design.

Jan 27 '06 #3

P: n/a
Or you could generate a pdf, which doesn't require your user to
download, install, and maintain another piece of software (if you think
pdf viewers are installed everywhere). Generating a pdf is usually as
simple as "print" with pdf being the target printer, using the adobe
driver ($), the paperport driver ($), or a free drive such as this one
http://www.primopdf.com

DoDahD wrote:
Jeff,
If this is a regular email attachment, you can output the report as
Snapshot. Your end used can download (or you can download for them)
from Microsoft the Access Snapshot viewer. This will provide
additional security, printing flexibility, and simplified support.
Your page breaks can be managed in the report design.

Jan 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.