Hello - I am using the following code to add some text to a document:
rve.Clear;
rve.ApplyTextStyle(6); // a style
rve.ApplyParaStyle(1); // a paragraph style
rve.InsertText('Here is a line of text');
The text is inserted, but not in the font and font size I specified in the text style (6) above. I have also tried
rve.Clear;
rve.AddNL('Here is a line of text'',6,1);
rve.Format;
No doubt I am missing something simple? I searched help and forums with not much success.
Thanks
Cannot apply text style
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Both these code samples must work. You only need to add rve.Format after rve.Clear in the first example (because editing method require formatted document):
rve.Clear;
rve.Format;
rve.ApplyTextStyle(6); // a style
rve.ApplyParaStyle(1); // a paragraph style
rve.InsertText('Here is a line of text');
If it does not work, please create a simple example reproducing this problem and send it to me by email.
rve.Clear;
rve.Format;
rve.ApplyTextStyle(6); // a style
rve.ApplyParaStyle(1); // a paragraph style
rve.InsertText('Here is a line of text');
If it does not work, please create a simple example reproducing this problem and send it to me by email.
I put together an example and the code worked correctly.
I fixed the problem in my project, but I am not sure as to the root cause.
The RVE field is populated from a database. If I would Null the database field out, the code would work correctly.
I also noticed that when I cleared a document and saved it to the database field, the field was in fact not empty, some information was there (binary format) and so it had something to do with this. Thanks
I fixed the problem in my project, but I am not sure as to the root cause.
The RVE field is populated from a database. If I would Null the database field out, the code would work correctly.
I also noticed that when I cleared a document and saved it to the database field, the field was in fact not empty, some information was there (binary format) and so it had something to do with this. Thanks
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: