Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Page Break in FSO 1

Status
Not open for further replies.

BobbaBuoy

Instructor
May 25, 2003
75
US
How can I do this?

Thanks~

Bobba Buoy
Just trying to make sense of it all ...
 
Use vbLf or Chr(10)

Something like strTextString & vbLf.

You can find all of them in the MSDN library under "Miscellaneous Constants
 
Sadly a linefeed isn't a page break, and there isn't a pagebreak ASCII code ...

The original question doesn't provide enough info

 
I agree about the post but I thought there was one for VB:

Chr(9) = tab
Chr(8) = backspace
Chr(11) end of line
Chr(12) new page
Chr(13) new line (=vbCrLF, = vb Cariage return and line feed)
Chr(14) new column (how you spell this in english ?)
Chr(20) new alinea

 
The particular post you have extracted is rather confused and wrong.

The closest you'd get with ASCII would theoretically be CHR(12) + vbCR - but we don't know whether we're talking about a text file, we don't know the output device (e.g a VB textbox doesn't understand or interpret CHR(12), nor does a richtextbox and nor does the printer.print methods

So, as I say, we need to know more from the original questioner
 
Perhaps the OP is talking about a page break in a Word document?

 
Yes, perhaps they are. But until the OP provides additional info we won't know.
 
Sorry about the delay in getting back to you all. This is very useful. The document is a *.rtf file that I am generating and I want to insert a page break depending on the length of the document. Right now I am inserting blank lines using the following code:

Code:
    If UBound(Races, 2) > 2 Then fname.WriteLine "\par\par\par\par\par\par\par\par\par\par\par\par"

But I am thinking there is a better way.

THanks again for your help and I await your response(s).

Bobba Buoy
Just trying to make sense of it all ...
 
Understand that there is no such concept as a "page break" in ASCII, and the FileSystemObject is typically used on ASCII files.

You could perhaps open Word programatically (using OLE automation) and use it to insert a "page break" in the document. I don't have any code handy at the moment, but searching these forums (or Google) on "Word OLE automation" should get you started.



 
I am generating the rtf file using:

Code:
    Set fs = CreateObject("Scripting.FileSystemObject")
    sFileName = sPath & "\" & sEventName & "_Reg_Form.rtf"
    Set fname = fs.CreateTextFile(sFileName, True)

And printing/posting online as needed. It is a registration form for a fitness event.

Bobba Buoy
Just trying to make sense of it all ...
 
So you are manually creating the RTF, putting in ALL the RTF tags and codes yourself?

And how are yout 'printing as needed'

And how are you 'posting online' as needed?
 
I am creating this programmatically in a vb app and using a cdl to open and print. I show it online by placing it in my web server and making it available via a link.

Bobba Buoy
Just trying to make sense of it all ...
 
Hmm ... I have no idea what a cdl is. But it does mostly sound like you can safely use SBerthold's \page suggestion (the reason I wanted to check how you were putting your rich text together, and how you were outputting it was because VB's RichTextbox does not support \page - indeed, it strips it out)
 
Ahh, I see. I will try the \page approach. If you do not hear from me you will know that it worked. Either way, thank you all very much again for all of the help!!!!

Bobba Buoy
Just trying to make sense of it all ...
 
And here I was thinking that Microsoft used [t]dlg[/t] as the Hungarian Notation prefix for common dialogs.


(but I'm sure that you're right in that that is what the OP meant)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top