Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default CreateTextFile method - Pagebreaks in the Text file

I am creating a text file using the following code:

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(FilePath & NameOfFile, True)

Now, in the new text file created, I want to insert page breaks.

What is the code to be written to have page breaks in the text file created?

- Murthy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default CreateTextFile method - Pagebreaks in the Text file

It is ASCiII code SOH (Start of Header) which is CHR(1).

So either
a.write chr(1)

or

a.writeline chr(1)

"Murthy" wrote:

I am creating a text file using the following code:

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(FilePath & NameOfFile, True)

Now, in the new text file created, I want to insert page breaks.

What is the code to be written to have page breaks in the text file created?

- Murthy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default CreateTextFile method - Pagebreaks in the Text file

Thanks.

Yes, chr(1) is writing something to the text file, but it really didn't
force a page break on a laser printer.

Still, I will test it on a line printer and get back.

Thanks for your help.



"Joel" wrote:

It is ASCiII code SOH (Start of Header) which is CHR(1).

So either
a.write chr(1)

or

a.writeline chr(1)

"Murthy" wrote:

I am creating a text file using the following code:

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(FilePath & NameOfFile, True)

Now, in the new text file created, I want to insert page breaks.

What is the code to be written to have page breaks in the text file created?

- Murthy


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default CreateTextFile method - Pagebreaks in the Text file

I thought formfeed was chr(12) (hex 0C).

I know that this worked on my old dot matrix printer from years ago--not sure if
it'll work with the OP's printer.

Joel wrote:

It is ASCiII code SOH (Start of Header) which is CHR(1).

So either
a.write chr(1)

or

a.writeline chr(1)

"Murthy" wrote:

I am creating a text file using the following code:

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(FilePath & NameOfFile, True)

Now, in the new text file created, I want to insert page breaks.

What is the code to be written to have page breaks in the text file created?

- Murthy



--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default CreateTextFile method - Pagebreaks in the Text file

You need to check the manual for your printer to find out what control
characters or escape sequence will produce a page break. Any of these
sequences can be made using a combination of chr() statements

PageBreak = chr(13) & chr(10) & ..............

"Murthy" wrote:

Thanks.

Yes, chr(1) is writing something to the text file, but it really didn't
force a page break on a laser printer.

Still, I will test it on a line printer and get back.

Thanks for your help.



"Joel" wrote:

It is ASCiII code SOH (Start of Header) which is CHR(1).

So either
a.write chr(1)

or

a.writeline chr(1)

"Murthy" wrote:

I am creating a text file using the following code:

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(FilePath & NameOfFile, True)

Now, in the new text file created, I want to insert page breaks.

What is the code to be written to have page breaks in the text file created?

- Murthy




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default CreateTextFile method - Pagebreaks in the Text file

Thanks Joel and Dave.

Finally Chr(12) has worked for my printer.

My sincere thanks to both of you again.

- Murthy

"Dave Peterson" wrote:

I thought formfeed was chr(12) (hex 0C).

I know that this worked on my old dot matrix printer from years ago--not sure if
it'll work with the OP's printer.

Joel wrote:

It is ASCiII code SOH (Start of Header) which is CHR(1).

So either
a.write chr(1)

or

a.writeline chr(1)

"Murthy" wrote:

I am creating a text file using the following code:

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(FilePath & NameOfFile, True)

Now, in the new text file created, I want to insert page breaks.

What is the code to be written to have page breaks in the text file created?

- Murthy



--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open tab text file method tony wong Excel Programming 1 August 4th 07 11:48 AM
Deleting PageBreaks asmenut Excel Programming 0 November 16th 05 10:37 PM
Is there no one who uses PageBreaks? HPageBreaks? GeorGeorGe Excel Worksheet Functions 0 February 11th 05 05:53 PM
pagebreaks Yiannis H. Economides Excel Programming 1 February 19th 04 04:03 PM
CreateTextFile not updating file Sean McPoland[_2_] Excel Programming 1 February 4th 04 10:58 PM


All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"