Solved

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

Posted on 2003-12-03
9
626 Views
Last Modified: 2013-11-22
Thank You
0
Comment
Question by:AlexF777
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 4

Expert Comment

by:TomLaw1999
Comment Utility
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
0
 
LVL 26

Expert Comment

by:EDDYKT
Comment Utility
N0

8->
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
Maybe.  

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...
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 175 total points
Comment Utility
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.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 26

Expert Comment

by:EDDYKT
Comment Utility
That may not be recognized by the printer

;->
0
 
LVL 42

Assisted Solution

by:frodoman
frodoman earned 75 total points
Comment Utility
TheLearnedOne is right - the page feed character is ascii 12 not 11.
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 175 total points
Comment Utility
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.
0
 
LVL 1

Expert Comment

by:holgrave
Comment Utility
How about vbCR & vbLF, LF being line feed.
0
 

Expert Comment

by:Jepal
Comment Utility
vbFormFeed works too if you don't like remembering ASCII.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

14 Experts available now in Live!

Get 1:1 Help Now