Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2003-12-03
9
Medium Priority
?
665 Views
Last Modified: 2013-11-22
Thank You
0
Comment
Question by:AlexF777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 4

Expert Comment

by:TomLaw1999
ID: 9869339
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
ID: 9869347
N0

8->
0
 
LVL 42

Expert Comment

by:frodoman
ID: 9869365
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 96

Accepted Solution

by:
Bob Learned earned 700 total points
ID: 9869403
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
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9869488
That may not be recognized by the printer

;->
0
 
LVL 42

Assisted Solution

by:frodoman
frodoman earned 300 total points
ID: 9869508
TheLearnedOne is right - the page feed character is ascii 12 not 11.
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 700 total points
ID: 9869529
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
ID: 9878459
How about vbCR & vbLF, LF being line feed.
0
 

Expert Comment

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses

604 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