Guy,
I think this may have to do with the fact that Microsofts RichTextBox
Control works off the .dll for Windows 95 regardless of what Operating
System you are running. This causes some weird problems including
packaging and deploying. VBAccelerator (http://www.vbaccelerator.com/)
created their own RichTextBox Control (which they give for free) to
resolve these issues. Try their control and see if it resolves your
problem.
Yehuda
-----Original Message-----
From: Guy Hedley [mailto:ghedley@e...]
Sent: Wednesday, January 16, 2002 8:49 AM
To: professional vb
Subject: [pro_vb] Re: How to add a page break in RTF?
I used Word 2000 to prove \sect gave me a page break by taking the file
generated by saving the contents of the RichTextBox control and removing
the additional "\" from "\\sect" via a plain ASCII editor (CodeWrite
V6.0).
I chose to use "\sect" because it was the only command supported by the
RichTextBox control, that I could see, to give me the page break I
required.
The route of my problem seems to be VBs insistence on translating the \
to \\.
Thanks,
Guy
-----Original Message-----
From: Seth Bembeneck [mailto:sbembeneck@c...]
Sent: 16 January 2002 13:23
To: professional vb
Subject: [pro_vb] Re: How to add a page break in RTF?
Here is what I get when I created a test RTF document in word pad then
opened it up in Notepad
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0
Arial;}}
\viewkind4\uc1\pard\f0\fs20 Testing 1.1.2.3.4.\par
\par
How is this working?\par
\par
\par
}
I tried adding a \sect but it did not do any thing. I don't know if you
will be able to do it using the RichText box control. I had a project
that was going to use an rtf file and what I just did was write to it
like a regular text file using the open command. When I wrote to the
file, I wrote it in using the proper syntext. I'll try to come up with
an example for you.
Seth
> I am using a RichTextBox control to create a report and I need to add
> a
page
> break.
>
> I've tried the following:
> rtfReport.SelRTF =3D "sect"
>
> Where "sect" is the RTF code to start a new section, therefore also
> resulting in a new page.
>
> But this just gives me "sect" within the file.
>
> So I tried adding the slash it requires:
> rtfReport.SelRTF =3D "\sect"
>
> But this gives me "\\sect" within the file, i.e. one too many slashes.
>
> Am I going down the wrong route and/or is there some trick required to
get
> this to work?
>
> Or is it impossible?
>
> I'm not bothered whether the RichTextBox can display it correctly,
since the
> control is never visible, as it is only used to create a report and
print or
> save it in RTF format.
>
>
> Thanks in advance,
>
> Guy
>
>
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to $subst('Email.Unsub').