473,399 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Convert RTF Text to Plain Text

Hi,

I have written a little Windows Service which converts tons of RTF docs from
RTF to Plain Text. I using the winform rtfbox. How ever sometimes this
crahses in background.

Does anybody know a better way? 3rd Party control or what ever?

Thanks in advance
Anthony

--
Anthony Malt
Feb 13 '06 #1
2 3831
CMM
Total guess here... but .NET doesn't bother to do stuff like create Win32
handles and things like that until you actually *display* the window. This
poses a problem for ActiveX controls. For instance, this led to problems
with the WebBrowser control in 2003. If you instantiated a form that
contained a web browser, but kept it hidden and never showed it (like
because the user never switched to it in your "tabbed" application) it would
crash your application when you exited.

Try showing the form... possibly offscreen (.Left = 0 - .Width, etc). Then
doing the work. I'm not sure how this plays out if your app is running as a
Windows "Service." I think you can still "Show" Windows (just nobody sees
them)... but, I'm not sure about that.

As a work around... every thought of using Word to do the dirty? Word has a
very good object model which would allow you to do this (basically as simple
as wd=CreateObject (or whatever it is in .NET), wd.OpenFile(rtffile)
wd.SaveAs(textfile))

--
-C. Moya
www.cmoya.com
"Anthony Malt" <An**********@sterm.com> wrote in message
news:uk**************@tk2msftngp13.phx.gbl...
Hi,

I have written a little Windows Service which converts tons of RTF docs
from RTF to Plain Text. I using the winform rtfbox. How ever sometimes
this crahses in background.

Does anybody know a better way? 3rd Party control or what ever?

Thanks in advance
Anthony

--
Anthony Malt

Feb 13 '06 #2

"Anthony Malt" <An**********@sterm.com> wrote in message
news:uk**************@tk2msftngp13.phx.gbl...
I have written a little Windows Service which converts tons of RTF docs
from RTF to Plain Text. I using the winform rtfbox. How ever sometimes
this crahses in background.

Does anybody know a better way? 3rd Party control or what ever?


If you have Word, why not use that? IME it will work fine and is easy to
automate.

Feb 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rob.kellington at gmail | last post by:
Does anyone have the logic to convert RTF formatted data in a text column into plain ascii text that I can use in a varchar variable or field? We have an app that allows formatted comments/notes...
4
by: Ted | last post by:
I have a SQL Server 2000 table with a few fields of "text" data type that contain rich text. I have to downstream this data and the recipient cannot handle rich text. I need to figure out a way...
4
by: Nedo | last post by:
hi is there a simple way to convert a html-string to a plain text-string? thanks Nedo
1
by: Dave | last post by:
Greetings, Is anybody aware of any code that will allow me to read .rtf or .doc or .pdf or .htm as plain text (so I can do a streamreader off them). Thanks, -Dave
6
by: Joerg Battermann | last post by:
Hey there, mmmm does anyone know a library or anything I can use to convert plaintext to html real quick and vice-versa? Regex surely would do the trick to a certain level, but maybe there's...
6
by: Justin | last post by:
Hi all, i need some help over here... i found the solution to export file from mysql db into *.csv. but is there anyway to convert the contents into *.doc and save in my webserver and providing a...
3
by: Vlad | last post by:
Hi! My task: Take HTML -convert into plain text. Sub-task: 1. Find all urls within HTML (<a href="http://www.abc.com">More about baby bears</a>). 2. And convert them into plain text: More...
8
by: geoffbache | last post by:
I have some marked up text and would like to convert it to plain text, by simply removing all the tags. Of course I can do it from first principles but I felt that among all Python's markup tools...
0
by: peridian | last post by:
Hi, Can I do a bulk "find and replace" on data in SQL Server to convert character set data? I have data coming in from multiple external sources. That data is not always in UTF-8 or ASCII...
0
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I need to convert doc, xls, pdf, rtf to plain Text. It should work like: string s = ConvertToText(@"C:\temp\text.doc"); What is the best component to use ?? Thanks for any comments....
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.