Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > rtf text saving


Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2004, 06:42 AM
mookie mookie is offline
Centurion
 
Join Date: Feb 2004
Posts: 179
Default rtf text saving


when i save my text file, i have to copy it from an rtftextbox to a regular text box. but when it gets saved, it reads

Code:
{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\lang1033\f0\fs17 &ACCESS RVO
\par &REL 203
\par &COMMENT none
\par DEF CHARLES()
\par 
\par END
\par }

how can i stop this from happening?
Reply With Quote
  #2  
Old 05-05-2004, 07:21 AM
Andi Wirth's Avatar
Andi Wirth Andi Wirth is offline
Privileges Suspended
 
Join Date: Mar 2004
Location: Vienna-Austria
Posts: 122
Default

To copy the text of a RTFBox to a simple textbox do:

Text1.Text = RTF1.Text

That's all.

If you store the text of a RTFBox to a file you have to watch out for 'vFlags' in RTF-SaveFile:

RTF1.SaveFile "c:\MyFile", vFlags

vFlags = 1 ... saves as text
vFlags = 0 ... saves as RTFText
Reply With Quote
  #3  
Old 05-05-2004, 09:51 AM
Agent707 Agent707 is offline
Retired Contributor
 
Join Date: Mar 2002
Posts: 1,829
Default

I was going to say the same thing. There's no reason to copy RTF text to a plain text box to save it "As plain text".

RTF1.SaveFile Path, rtfText
Quote:
vFlags = 1 ... saves as text
vFlags = 0 ... saves as RTFText
You have the 0 (plain text) and 1 (Rich text) right.
But rtfTEXT is const for plain text, or 1
rtfRTF is const for Rich Text.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching Text in between 2 tags Mohanme_2000 Word, PowerPoint, Outlook, and Other Office Products 1 02-21-2004 11:20 PM
Saving A File As The Text Box Label ? DY357LX File I/O and Registry 2 02-19-2004 07:53 PM
Saving text array mike1234 General 2 01-28-2004 06:06 AM
Saving multiline text to DB... adBSTRD General 2 11-21-2003 10:57 AM
Adding onto a text file, Instead of saving over. tHe LiNk File I/O and Registry 10 06-11-2003 04:51 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->