Is there any way to insert a page break in plain .txt file from within VB6 ?

Thank You
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

use the ForcePageBreak Property. i.e.

object.ForcePageBreak = integer

The settings for integer are:

Constant Value Description
rptPageBreakNone 0 (Default) No page breaks occur.
rptPageBreakBefore 1 The page break occurs before the current section.
rptPageBreakAfter 2 The page break occurs after the current section.
rptPageBreakBeforeAndAfter 3 Page breaks occur both before and after the current section


You can insert chr(11) which is the ascii standard "form feed" character; however, whether this is handled as a page break depends on which application you use to display the .txt file...
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Bob LearnedCommented:
If you are going to open the text file in a program like Word, something like this will work:

   Open "c:\temp\test.txt" For Output As #1
   Print #1, "This is a test" & Chr$(12)
   Print #1, "This line is on the next page"
   Close #1

   Chr$(12) is the page feed character.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
That may not be recognized by the printer

TheLearnedOne is right - the page feed character is ascii 12 not 11.
Bob LearnedCommented:
Generally speaking, Ascii(12) is the universal character for page feed.  It may not work in 100% of the cases, but it was true from back in the days when I used dot matrix printers, and it should still be true with other printer types.
How about vbCR & vbLF, LF being line feed.
vbFormFeed works too if you don't like remembering ASCII.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.